Skip to content

Commit

Permalink
[FIX] l10n_ch: display qr_code once on reprint
Browse files Browse the repository at this point in the history
Steps to reproduce:
- In Settings/technical/actions/reports: find the invoice report
- in advanced: activate "Reload from attachment"
- create an invoice with a swiss customer
- confirm and print
- print the invoice again

Issue:
There are two pages with the same qr-code

opw-3626815

closes odoo#147281

X-original-commit: a6e0653
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
  • Loading branch information
yosa-odoo committed Dec 22, 2023
1 parent a720075 commit 1be4f8f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addons/l10n_ch/models/ir_actions_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def _render_qweb_pdf_prepare_streams(self, report_ref, data, res_ids=None):
# Determine which invoices need a QR.
qr_inv_ids = []
for invoice in invoices:
# avoid duplicating existing streams
if report.attachment_use and report.retrieve_attachment(invoice):
continue
if invoice.l10n_ch_is_qr_valid:
qr_inv_ids.append(invoice.id)
# Render the additional reports.
Expand Down

0 comments on commit 1be4f8f

Please sign in to comment.