[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
This commit is contained in:
Yannick Tivisse
2018-11-20 14:40:16 +00:00
parent 82f7fdd66b
commit 602f7ea0bc
+1 -2
View File
@@ -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,