[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)
This commit is contained in:
Prakash Prajapati
2017-09-19 10:50:51 +02:00
committed by Yannick Tivisse
parent 43e412ccab
commit 4afdc57c88
4 changed files with 7 additions and 3 deletions
+2 -1
View File
@@ -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'),
@@ -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) {
+2 -1
View File
@@ -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'),
+2 -1
View File
@@ -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',