Repository navigation
[18.0][FIX] account_financial_report: plain text tax descriptions in journal ledger - #1592
Open
parabol123654 wants to merge 1 commit into
Open
parabol123654 wants to merge 1 commit into
parabol123654 wants to merge 1 commit into
Conversation
pedrobaeza
reviewed
Oct 28, 2026
pedrobaeza
left a comment
Member
There was a problem hiding this comment.
Can you reuse an existing test instead of doing a new one? If we keep creating new test cases, the code for tests will be unmaintainable and very slow for each build.
Member
|
Please don't join several patches in the same PR, and also sign the CLA. |
parabol123654
force-pushed
the
18.0-fix-account_financial_report-tax-description-html
branch
from
October 29, 2026 16:11
9f58589 to
f215ff6
Compare
Author
|
Thanks, done: this PR now only has the tax description fix (one commit), and the t-eval fix is in its own PR, #1593. The CLA is signed too. |
…l ledger
account.tax.description is an Html field in 18.0: once edited in the
web editor it holds e.g. <div data-oe-version="1.1">IGIC 7%</div>.
The journal ledger printed it as Markup in the Taxes column after
label_text_limit cut it, leaving a <div> open for every tax line, so
each following move was nested in the previous one ("staircase").
Convert the description to plain text, falling back on the tax name.
Fixes OCA#1545
Assisted-by: Claude Opus 5.5
parabol123654
force-pushed
the
18.0-fix-account_financial_report-tax-description-html
branch
from
November 14, 2026 17:47
f215ff6 to
3ec258c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_04_tax_description_htmlgives the purchase tax an editor-style description, posts a bill, and 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