From 4afdc57c88cc94b4c8b6ab95c146632a7fca7264 Mon Sep 17 00:00:00 2001 From: Prakash Prajapati Date: Tue, 12 Sep 2017 12:51:47 +0530 Subject: [PATCH] [FIX] mail: Open simple partner form when email is requested on actions Purpose ======= When you want to send an email to a contact without an email address set, you get a wizard to enter the contact email. In master, you get the full contact form You should get the simplified form view (like in 10.0) --- addons/account/models/account_invoice.py | 3 ++- addons/mail/static/src/js/many2many_tags_email.js | 1 + addons/purchase/models/purchase.py | 3 ++- addons/sale/models/sale.py | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 5f9b93f0d85..f3af53af8fc 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -563,7 +563,8 @@ class AccountInvoice(models.Model): default_template_id=template and template.id or False, default_composition_mode='comment', mark_invoice_as_sent=True, - custom_layout="account.mail_template_data_notification_email_account_invoice" + custom_layout="account.mail_template_data_notification_email_account_invoice", + force_email=True ) return { 'name': _('Compose Email'), diff --git a/addons/mail/static/src/js/many2many_tags_email.js b/addons/mail/static/src/js/many2many_tags_email.js index c566d2a4706..96688a06dbc 100644 --- a/addons/mail/static/src/js/many2many_tags_email.js +++ b/addons/mail/static/src/js/many2many_tags_email.js @@ -80,6 +80,7 @@ var FieldMany2ManyTagsEmail = M2MTags.extend({ var pop = new form_common.FormViewDialog(self, { res_model: self.field.relation, res_id: resID, + context: self.record.context, title: _t("Please complete partner's informations and Email"), on_saved: function (record) { if (record.data.email) { diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index d048cfefc02..422c0bd30f6 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -306,7 +306,8 @@ class PurchaseOrder(models.Model): 'default_use_template': bool(template_id), 'default_template_id': template_id, 'default_composition_mode': 'comment', - 'custom_layout': "purchase.mail_template_data_notification_email_purchase_order" + 'custom_layout': "purchase.mail_template_data_notification_email_purchase_order", + 'force_email': True }) return { 'name': _('Compose Email'), diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 9b354af7ab6..160264707a8 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -477,7 +477,8 @@ class SaleOrder(models.Model): 'default_composition_mode': 'comment', 'mark_so_as_sent': True, 'custom_layout': "sale.mail_template_data_notification_email_sale_order", - 'proforma': self.env.context.get('proforma', False) + 'proforma': self.env.context.get('proforma', False), + 'force_email': True } return { 'type': 'ir.actions.act_window',