← Back to Pull requests

[18.0][FIX] account_financial_report: plain text tax descriptions in journal ledger #1592

Open
unknown opened this pull request with 208 lines diff across 2 files
View on GitHub
unknown unknown commented on Oct 28, 2026 08:49 UTC
Author

Fixes #1545.

Problem: in 18.0 account.tax.description is an Html field. Once it is edited in the web editor it holds e.g. <div data-oe-version="1.1">IGIC 7%</div>. The Journal Ledger shows it in the Taxes column of tax lines through limit_text(...): the value is Markup, so t-esc does not escape it, and label_text_limit (40 by default) cuts it in the middle, leaving a <div> open for every tax line. Each following move is then nested in the previous one (the "staircase" layout from the issue). The XLSX export shows the raw HTML in the same column.

Fix: _get_ml_tax_description converts the description to plain text with html2plaintext, and falls back on the tax name when the description is empty (an emptied editor leaves <p><br></p>, which is truthy).

Test: test_03_test_taxes_in_invoice now gives the purchase tax an editor-style description and also checks the description the wizard returns for the tax line: plain text, and the tax name when the description is an emptied editor (<p><br></p>). Without the fix it fails (the wizard returns the Markup); with the fix it passes, along with the rest of the module's tests (28 tests on Odoo 18.0).

The t-eval warning in the same template is fixed separately in #1593.

The per-journal tax summary table also prints the description, but uncut, so it does not break the layout; this PR leaves it as is. The same code is in 19.0; I can forward-port once this is merged.

(#1567 proposed a similar change but was closed by its author without review. #1418 touches the per-line taxes data next to this code; the two changes do not conflict.)

Assisted-by: Claude Opus 5.5

Diff: 208 lines (+156 / -52) across 2 files Reviewer: parabol123654 Review duration: 48635m
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.43) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 208 lines diff across 2 files
0.43
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
44%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.320
Real PR Conversation Timeline
1 comments
"Review active on #1592"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 44.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 43.4% (MEDIUM) · Higher = larger blast radius
43.4%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 44.7% · Lower = rushed or shallow review
44.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 24% · Safe to merge
24%