[MERGE] Merged small fix of email_template. It fixes a crash when using 'send by email' on a partner without email address. It also fixes a bug when using 'send by email' in create mode. It now falls back on the classic form view of mail.compose.message.
bzr revid: tde@openerp.com-20120808082529-6cifcklh06hf1w11
This commit is contained in:
@@ -317,6 +317,7 @@ class email_template(osv.osv):
|
||||
'message_id': False,
|
||||
'state': 'outgoing',
|
||||
'content_subtype': 'plain',
|
||||
'partner_ids': [],
|
||||
}
|
||||
if not template_id:
|
||||
return values
|
||||
|
||||
@@ -16,7 +16,7 @@ openerp.mail = function(session) {
|
||||
|
||||
session.web.FormView = session.web.FormView.extend({
|
||||
do_action: function(action, on_close) {
|
||||
if (action.res_model == 'mail.compose.message' && this.fields && this.fields.message_ids) {
|
||||
if (action.res_model == 'mail.compose.message' && this.fields && this.fields.message_ids && this.fields.message_ids.view.get("actual_mode") != 'create') {
|
||||
var record_thread = this.fields.message_ids;
|
||||
var thread = record_thread.thread;
|
||||
thread.instantiate_composition_form('comment', true, false, 0, action.context);
|
||||
|
||||
Reference in New Issue
Block a user