summaryrefslogtreecommitdiff
path: root/addons/email_template/email_template.py
diff options
context:
space:
mode:
authorTurkesh Patel (Open ERP) <tpa@tinyerp.com>2014-01-23 19:12:33 +0530
committerTurkesh Patel (Open ERP) <tpa@tinyerp.com>2014-01-23 19:12:33 +0530
commit43ba81ad1bfbbd35ad0c641dcfb05ab481eda75c (patch)
tree51e43a3b26234637357f5da5aa9ed6e5dc321d97 /addons/email_template/email_template.py
parenta8d65e4fa9c7fa598cd0cf79dfd46f453882eaad (diff)
[IMP] use product.template model for templates
bzr revid: tpa@tinyerp.com-20140123134233-vp52fv0e047bbfgk
Diffstat (limited to 'addons/email_template/email_template.py')
-rw-r--r--addons/email_template/email_template.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py
index 8a16c01a156..36622c3ba14 100644
--- a/addons/email_template/email_template.py
+++ b/addons/email_template/email_template.py
@@ -213,6 +213,12 @@ 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')