[FIX] l10n_ch: display qr_code once on reprint

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/odoo#147281

X-original-commit: a6e06531cdd15736b6ed51702e6ba17fb73fe89d
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
This commit is contained in:
Yolann Sabaux
2023-12-22 13:31:44 +00:00
parent a72007508a
commit 1be4f8f783
@@ -38,6 +38,9 @@ class IrActionsReport(models.Model):
# 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.