[FIX] Fixed fix of revision 7750. Correct fix was to add in the generated action an use_template context key, that triggers the use of templates. Eveything is then managed inside the email_template override of mail.compose.message.
bzr revid: tde@openerp.com-20121016115839-8cj0u9si20qo14av
This commit is contained in:
parent
e915bd83cb
commit
c3aecf0630
|
@ -175,7 +175,7 @@ class email_template(osv.osv):
|
||||||
'res_model': 'mail.compose.message',
|
'res_model': 'mail.compose.message',
|
||||||
'src_model': src_obj,
|
'src_model': src_obj,
|
||||||
'view_type': 'form',
|
'view_type': 'form',
|
||||||
'context': "{'default_composition_mode': 'mass_mail', 'default_template_id' : %d}" % (template.id),
|
'context': "{'default_composition_mode': 'mass_mail', 'default_template_id' : %d, 'default_use_template': True}" % (template.id),
|
||||||
'view_mode':'form,tree',
|
'view_mode':'form,tree',
|
||||||
'view_id': res_id,
|
'view_id': res_id,
|
||||||
'target': 'new',
|
'target': 'new',
|
||||||
|
|
|
@ -25,6 +25,7 @@ openerp.mail = function(session) {
|
||||||
*/
|
*/
|
||||||
for(var key in action.context){
|
for(var key in action.context){
|
||||||
if( key!='default_template_id' &&
|
if( key!='default_template_id' &&
|
||||||
|
key!='default_composition_mode' &&
|
||||||
key!='default_use_template' &&
|
key!='default_use_template' &&
|
||||||
key!='default_is_private' &&
|
key!='default_is_private' &&
|
||||||
key!='default_model' &&
|
key!='default_model' &&
|
||||||
|
|
|
@ -81,11 +81,7 @@ class mail_compose_message(osv.TransientModel):
|
||||||
elif composition_mode == 'comment' and model and res_id:
|
elif composition_mode == 'comment' and model and res_id:
|
||||||
vals = self.get_record_data(cr, uid, model, res_id, context=context)
|
vals = self.get_record_data(cr, uid, model, res_id, context=context)
|
||||||
elif composition_mode == 'mass_mail' and model and active_ids:
|
elif composition_mode == 'mass_mail' and model and active_ids:
|
||||||
if context.get('default_template_id'):
|
vals = {'model': model, 'res_id': res_id, 'content_subtype': 'html'}
|
||||||
vals = self.pool.get('email.template').generate_email(cr, uid, context.get('default_template_id'), res_id, context=context)
|
|
||||||
vals.update({'content_subtype': 'html'})
|
|
||||||
else:
|
|
||||||
vals = {'model': model, 'res_id': res_id, 'content_subtype': 'html'}
|
|
||||||
else:
|
else:
|
||||||
vals = {'model': model, 'res_id': res_id}
|
vals = {'model': model, 'res_id': res_id}
|
||||||
if composition_mode:
|
if composition_mode:
|
||||||
|
|
Loading…
Reference in New Issue