Skip to content

Commit

Permalink
[FIX] l10n_it_central_journal_reportlab account_name formatting error
Browse files Browse the repository at this point in the history
When extracting a grouped report, if `<` or `>` are in the account_name variable
they are interpreted as html tags and an error is raised. This fixes the issue.
  • Loading branch information
techgrrow authored and jado95 committed Dec 6, 2024
1 parent a690dd7 commit a1e13af
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion l10n_it_central_journal_reportlab/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ITA - Libro giornale - Reportlab
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:14273fa46a9791a84bcc003341f36d2fec2f3ae0cf218759d9326a8e408a9d20
!! source digest: sha256:61dcfdb267425d63d6bee99109adddf11c6a4fe7e90d15b451a13e62d7d8ca8f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion l10n_it_central_journal_reportlab/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "ITA - Libro giornale - Reportlab",
"version": "16.0.1.0.3",
"version": "16.0.1.0.4",
"development_status": "Beta",
"category": "Localization/Italy",
"author": "Gianmarco Conte - Dinamiche Aziendali srl, "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ <h1 class="title">ITA - Libro giornale - Reportlab</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:14273fa46a9791a84bcc003341f36d2fec2f3ae0cf218759d9326a8e408a9d20
!! source digest: sha256:61dcfdb267425d63d6bee99109adddf11c6a4fe7e90d15b451a13e62d7d8ca8f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_central_journal_reportlab"><img alt="OCA/l10n-italy" src="https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_central_journal_reportlab"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><strong>Italiano</strong></p>
Expand Down
6 changes: 6 additions & 0 deletions l10n_it_central_journal_reportlab/wizard/print_giornale.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ def get_grupped_final_tables_report_giornale(
if line["account_code"]
else line["account_name"]
)
# evitiamo che i caratteri < o > vengano interpretato come tag html
# dalla libreria reportlab
account_name = account_name.replace("<", "&lt;").replace(">", "&gt;")
account = Paragraph(account_name, style_name)
name = Paragraph(line["name"], style_name)
# dato che nel SQL ho la somma dei crediti e debiti potrei avere
Expand Down Expand Up @@ -393,6 +396,9 @@ def get_final_tables_report_giornale(
move_name = line.move_id.name or ""
move = Paragraph(move_name, style_name)
account_name = self._get_account_name_reportlab(line)
# evitiamo che i caratteri < o > vengano interpretato come tag html
# dalla libreria reportlab
account_name = account_name.replace("<", "&lt;").replace(">", "&gt;")
account = Paragraph(account_name, style_name)
if line.account_id.account_type in [
"asset_receivable",
Expand Down

0 comments on commit a1e13af

Please sign in to comment.