Module
account_financial_report 18.0.1.4.20 (Odoo 18.0)
Describe the bug
The Journal Ledger HTML report renders completely broken — every move nests inside the previous one, producing a diagonal "staircase" layout — when any account.tax has a description that contains HTML.
In Odoo 18 account.tax.description is an Html field. As soon as a user edits it through the web editor, its value becomes e.g.:
<div data-oe-version="1.1">IGIC 7%</div>
Root cause
In report/templates/journal_ledger.xml, the taxes cell of report_journal_move_line does:
<span t-esc="limit_text(o._get_ml_tax_description(move_line, tax_line_dat, move_line_ids_taxes_dat), 'label_text_limit')" />
Two things combine:
- The Html field value is a
Markup object, so t-esc does not escape it — the raw HTML is injected into the report.
limit_text truncates it by slicing, cutting off the closing </div> mid-tag.
Result: one unclosed <div> is emitted per tax line. In HTML parsing every subsequent element nests inside it, so the whole report collapses into a staircase (in our real-world ledger: 111 unclosed divs). The PDF variant is affected by the same raw-HTML injection.
Steps to reproduce
- On any
account.tax, edit Description displayed on invoices via the backend form (the web editor wraps the text: <div data-oe-version="1.1">…</div>).
- Post an invoice using that tax.
- Run Journal Ledger over a period containing that move and open the HTML output.
Expected behavior
The taxes column should show plain text. Suggested fix: strip HTML before truncating, e.g. html2plaintext() inside _get_ml_tax_description() (or make limit_text coerce Markup to plain str and escape).
Additional observations
- QWeb logs
Unknown directives or unused attributes: {'t-eval'} in account_financial_report.report_journal_move — lines <t t-set="last_partner" t-eval="None"/> / <t t-set="display_partner" t-eval="True"/> use the removed t-eval directive, so those t-set are no-ops in 18.0.
- Unrelated but worth noting: the
es_ES translation of report_journal_ledger_journal_table_header translates the literal style terms (width: 8.11%; → ancho: 8.11%;), so two columns lose their width in Spanish. Probably a Weblate artifact.
Module
account_financial_report 18.0.1.4.20 (Odoo 18.0)
Describe the bug
The Journal Ledger HTML report renders completely broken — every move nests inside the previous one, producing a diagonal "staircase" layout — when any
account.taxhas adescriptionthat contains HTML.In Odoo 18
account.tax.descriptionis an Html field. As soon as a user edits it through the web editor, its value becomes e.g.:Root cause
In
report/templates/journal_ledger.xml, the taxes cell ofreport_journal_move_linedoes:Two things combine:
Markupobject, sot-escdoes not escape it — the raw HTML is injected into the report.limit_texttruncates it by slicing, cutting off the closing</div>mid-tag.Result: one unclosed
<div>is emitted per tax line. In HTML parsing every subsequent element nests inside it, so the whole report collapses into a staircase (in our real-world ledger: 111 unclosed divs). The PDF variant is affected by the same raw-HTML injection.Steps to reproduce
account.tax, edit Description displayed on invoices via the backend form (the web editor wraps the text:<div data-oe-version="1.1">…</div>).Expected behavior
The taxes column should show plain text. Suggested fix: strip HTML before truncating, e.g.
html2plaintext()inside_get_ml_tax_description()(or makelimit_textcoerceMarkupto plainstrand escape).Additional observations
Unknown directives or unused attributes: {'t-eval'} in account_financial_report.report_journal_move— lines<t t-set="last_partner" t-eval="None"/>/<t t-set="display_partner" t-eval="True"/>use the removedt-evaldirective, so thoset-setare no-ops in 18.0.es_EStranslation ofreport_journal_ledger_journal_table_headertranslates the literalstyleterms (width: 8.11%;→ancho: 8.11%;), so two columns lose their width in Spanish. Probably a Weblate artifact.