From 602f7ea0bc3b64bc3c6256aff6fdc294f4c81f85 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Tue, 20 Nov 2018 14:40:16 +0000 Subject: [PATCH] [FIX] lunch: Fix unreviewed new feature from a2f69ca Purpose ======= As we try to open a mail.compose.message on a model that doesn't inherit from mail.thread (Mimic a cowboy yellin' "Yihaaa" while shooting into the air with one revolver in each hand). Specification ============= The only way to fix this issue while keeping the feature (Open a mail composer) is to open the mail composer in mass_mail mode and to remove the model on which it should be called. The template won't be rendered in the mail composer but will be rendered when sending the mass_mailing obviously, while avoiding the unavoidable traceback when clicking on the 'Send' button closes odoo/odoo#28849 --- addons/lunch/models/lunch.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/lunch/models/lunch.py b/addons/lunch/models/lunch.py index facc3d44809..19aad72ef22 100644 --- a/addons/lunch/models/lunch.py +++ b/addons/lunch/models/lunch.py @@ -266,8 +266,7 @@ class LunchOrderLine(models.Model): template = self.env.ref('lunch.lunch_order_mail_supplier', raise_if_not_found=False) ctx = dict( - default_composition_mode='comment', - default_model='lunch.order', + default_composition_mode='mass_mail', default_use_template=bool(template), default_template_id=template.id, default_lang=order['supplier'].lang or self.env.user.lang,