[IMP] email_template: already generate tmeplate values in default_get
bzr revid: tde@openerp.com-20131120135904-r630n937txivqak9
This commit is contained in:
parent
d1bc4d3766
commit
4fb0880259
|
@ -41,6 +41,21 @@ def _reopen(self, res_id, model):
|
|||
class mail_compose_message(osv.TransientModel):
|
||||
_inherit = 'mail.compose.message'
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
"""
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
res = super(mail_compose_message, self).default_get(cr, uid, fields, context=context)
|
||||
if context.get('default_template_id'):
|
||||
res.update(
|
||||
self.onchange_template_id(
|
||||
cr, uid, [], context['default_template_id'], res.get('composition_mode'),
|
||||
res.get('model'), res.get('res_id'), context=context
|
||||
)['value']
|
||||
)
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'template_id': fields.many2one('email.template', 'Use template', select=True),
|
||||
'partner_to': fields.char('To (Partner IDs)',
|
||||
|
|
Loading…
Reference in New Issue