[MERGE] email_template: correctly pass template id via context
This fixes the sidebar action buttons that are supposed to open a given template, but actually opened an empty form lp bug: https://launchpad.net/bugs/915372 fixed lp bug: https://launchpad.net/bugs/886144 fixed bzr revid: odo@openerp.com-20120125173403-dit8zp3ggalajdhq
This commit is contained in:
commit
f0fdfc450c
|
@ -186,7 +186,7 @@ class email_template(osv.osv):
|
|||
'res_model': 'mail.compose.message',
|
||||
'src_model': src_obj,
|
||||
'view_type': 'form',
|
||||
'context': "{'mail.compose.message.mode':'mass_mail'}",
|
||||
'context': "{'mail.compose.message.mode':'mass_mail', 'mail.compose.template_id' : %d}" % (template.id),
|
||||
'view_mode':'form,tree',
|
||||
'view_id': res_id,
|
||||
'target': 'new',
|
||||
|
|
|
@ -69,6 +69,10 @@ class mail_compose_message(osv.osv_memory):
|
|||
size=-1 # means we want an int db column
|
||||
),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'template_id' : lambda self, cr, uid, context={} : context.get('mail.compose.template_id', False)
|
||||
}
|
||||
|
||||
def on_change_template(self, cr, uid, ids, use_template, template_id, email_from=None, email_to=None, context=None):
|
||||
if context is None:
|
||||
|
|
Loading…
Reference in New Issue