From 4754717eb5f0970dd0fa2f940a47850c2d524d4e Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Thu, 9 Jan 2020 06:18:18 +0000 Subject: [PATCH] [FIX] account: fix traceback when sending invoice without template Create an invoice, click on send and print without an associated template. Traceback will occur because the lang parameter is set correctly only from a template. Adding a fallback in case there is no template setting opw-2168623 closes odoo/odoo#43008 X-original-commit: 8fd8fdcf0fa6fb26a1797ad2b40fcaf34d23eee2 Signed-off-by: Nicolas Martinelli (nim) --- addons/account/models/account_move.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 64acf3a003c..1b6cc337c80 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -2186,6 +2186,8 @@ class AccountMove(models.Model): lang = get_lang(self.env) if template and template.lang: lang = template._render_template(template.lang, 'account.move', self.id) + else: + lang = lang.code compose_form = self.env.ref('account.account_invoice_send_wizard_form', raise_if_not_found=False) ctx = dict( default_model='account.move',