[18.0][FIX] account_financial_report: plain text tax descriptions in journal ledger #1592
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
parabol123654
Fixes #1545.
Problem: in 18.0
account.tax.descriptionis 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 throughlimit_text(...): the value isMarkup, sot-escdoes not escape it, andlabel_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_descriptionconverts the description to plain text withhtml2plaintext, 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_invoicenow 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 theMarkup); with the fix it passes, along with the rest of the module's tests (28 tests on Odoo 18.0).The
t-evalwarning 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