[FIX] account: fix email onchange on invoice template

- Activate debug mode
- Go to Settings > Technical > Templates
- Duplicate "Invoice: Send by email" and edit the copy (Name & Content)
- Go to Accounting > Customers > Invoices and create an Invoice
- Post it
- Send & Print
- In the wizard, select the duplicated template (the content will be updated)
- Uncheck "Email" option, the re-check it
The selected template is still the duplicated one, but the content is the one from the default template.

opw-2345200

closes odoo/odoo#59628

X-original-commit: cd6c54b15ce328b58888a4f33a64ae61c7744a90
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
This commit is contained in:
Anh Thao Pham (pta)
2020-10-09 11:57:38 +00:00
parent 69a942d363
commit 45eb9f0503
@@ -63,6 +63,8 @@ class AccountInvoiceSend(models.TransientModel):
'composition_mode': 'comment' if len(res_ids) == 1 else 'mass_mail',
'template_id': self.template_id.id
})
else:
self.composer_id.template_id = self.template_id.id
self.composer_id.onchange_template_id_wrapper()
@api.onchange('is_email')