[CLEAN] email_template: cleaned code
bzr revid: tde@openerp.com-20140124114743-m6s8d1byabl78l63
This commit is contained in:
parent
5d17667bb1
commit
b845b708af
|
@ -76,6 +76,12 @@ class email_template(osv.osv):
|
|||
_description = 'Email Templates'
|
||||
_order = 'name'
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
res = super(email_template, self).default_get(cr, uid, fields, context)
|
||||
if res.get('model'):
|
||||
res['model_id'] = self.pool['ir.model'].search(cr, uid, [('model', '=', res.pop('model'))], context=context)[0]
|
||||
return res
|
||||
|
||||
def render_template_batch(self, cr, uid, template, model, res_ids, context=None):
|
||||
"""Render the given template text, replace mako expressions ``${expr}``
|
||||
with the result of evaluating these expressions with
|
||||
|
@ -213,12 +219,6 @@ class email_template(osv.osv):
|
|||
'auto_delete': True,
|
||||
}
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
res = super(email_template, self).default_get(cr, uid, fields, context)
|
||||
if context.get('default_model'):
|
||||
res['model_id'] = self.pool.get('ir.model').search(cr, uid, [('model', '=', context.get('default_model'))], context=context)[0]
|
||||
return res
|
||||
|
||||
def create_action(self, cr, uid, ids, context=None):
|
||||
action_obj = self.pool.get('ir.actions.act_window')
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
|
|
Loading…
Reference in New Issue