From 4e038b36153111fb6647f51359f564d5a7c2adcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 17 Jul 2012 15:23:29 +0200 Subject: [PATCH] [IMP] email_template: override name_get, because old one coming from mail.message.common was quite ugly for email templates. bzr revid: tde@openerp.com-20120717132329-5m15l8akdu8hksy4 --- addons/email_template/email_template.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index 859d4647050..16b66982d14 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -101,6 +101,11 @@ class email_template(osv.osv): mod_name = self.pool.get('ir.model').browse(cr, uid, model_id, context).model return {'value':{'model': mod_name}} + def name_get(self, cr, uid, ids, context=None): + """ Override name_get of mail.message: return directly the template + name, and not the generated name from mail.message.common.""" + return [(record.id, record.name) for record in self.browse(cr, uid, ids, context=context)] + _columns = { 'name': fields.char('Name', size=250), 'model_id': fields.many2one('ir.model', 'Related document model'),