From 4ee306f1b1556512ac34ff2b233473e22a48b335 Mon Sep 17 00:00:00 2001 From: Renzo Meister Date: Tue, 10 May 2022 15:20:53 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Settings=20to=20define=20if=20ISR?= =?UTF-8?q?=20and=20QR=20should=20be=20added=20to=20email=20template,=20an?= =?UTF-8?q?d=20also=20if=20it=20should=20only=20be=20done=20when=20invoice?= =?UTF-8?q?=20is=20not=20paid=20->l10n=5Fch=5Freport=5Foptional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_ch_report_optional/models/mail_template.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/l10n_ch_report_optional/models/mail_template.py b/l10n_ch_report_optional/models/mail_template.py index 308cc91..5e471fe 100644 --- a/l10n_ch_report_optional/models/mail_template.py +++ b/l10n_ch_report_optional/models/mail_template.py @@ -25,6 +25,8 @@ def generate_email(self, res_ids, fields): if self.model == 'account.move': for record in self.env[self.model].browse(res_ids): + if record.move_type != 'out_invoice': + continue inv_print_name = self._render_field('report_name', record.ids, compute_lang=True)[record.id] new_attachments = [] if not self.env.company.l10n_ignore_qr_when_reconciled or record.payment_state != 'paid':