Skip to content
Snippets Groups Projects
Commit 14d78f96 authored by Eric Antones's avatar Eric Antones
Browse files

[FIX] l10n_ch: a QR report is generated although the option is disabled


 This takes into account the option that allows to disable/enable the QR file generation

 Closes #85283

closes odoo/odoo#125038

X-original-commit: 7b433492
Signed-off-by: default avatarJohn Laterre (jol) <jol@odoo.com>
parent 63123733
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,10 @@ class MailTemplate(models.Model):
new_attachments = []
include_qr_report = 'l10n_ch.l10n_ch_qr_report' not in self.env.context.get('l10n_ch_mail_skip_report', [])
if include_qr_report and record.move_type == 'out_invoice' and record.partner_bank_id._eligible_for_qr_code('ch_qr', record.partner_id, record.currency_id):
if include_qr_report and \
record.move_type == 'out_invoice' and \
record.partner_bank_id._eligible_for_qr_code('ch_qr', record.partner_id, record.currency_id) and \
record.display_qr_code:
# We add an attachment containing the QR-bill
qr_report_name = 'QR-bill-' + inv_print_name + '.pdf'
qr_pdf = self.env.ref('l10n_ch.l10n_ch_qr_report')._render_qweb_pdf(record.ids)[0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment