From 3ae25d62bb25569cbe5adb809e394b6427fe6b40 Mon Sep 17 00:00:00 2001 From: Yolann Sabaux Date: Thu, 13 Jan 2022 15:57:00 +0000 Subject: [PATCH] [FIX] account: adequate template loading at first time Steps to reproduce: - install accounting (account_accountant) - go to invoice - click on "send and print" -> template is not loaded directly Solution: - revert changes of commit #fc5812c327daab4 since the onchange is now called only once OPW-2732687 closes odoo/odoo#82805 X-original-commit: fa25a3b2b7cdafbce70e39a8a896924f015185a9 Signed-off-by: Nicolas Lempereur (nle) Signed-off-by: yosa-odoo --- addons/account/models/account_move.py | 1 - addons/account/wizard/account_invoice_send.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 6994a6dcc90..f622050b201 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -3165,7 +3165,6 @@ class AccountMove(models.Model): default_email_layout_xmlid="mail.mail_notification_paynow", model_description=self.with_context(lang=lang).type_name, force_email=True, - wizard_opened=True ) return { 'name': _('Send Invoice'), diff --git a/addons/account/wizard/account_invoice_send.py b/addons/account/wizard/account_invoice_send.py index ce951d44a2e..c4384055eb2 100644 --- a/addons/account/wizard/account_invoice_send.py +++ b/addons/account/wizard/account_invoice_send.py @@ -93,8 +93,7 @@ class AccountInvoiceSend(models.TransientModel): self.composer_id.composition_mode = 'comment' if len(res_ids) == 1 else 'mass_mail' self.composer_id.template_id = self.template_id.id self._compute_composition_mode() - if not self.env.context.get("wizard_opened"): - self.composer_id._onchange_template_id_wrapper() + self.composer_id._onchange_template_id_wrapper() @api.onchange('is_email') def _compute_invoice_without_email(self):