From 67cca3f1e5489a81996d1ba20586749490d8665a Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Tue, 15 Jul 2014 16:17:36 -0400 Subject: [PATCH] [FIX] mail: display translated model name at record creation When a record is created, if it inherits from mail.thread, a message 'OBJECT created' is posted. 'created' is translated but the name of the model wasn't. This fix uses the name of the linked ir.model which is already a translatable field. lp:1262000, opw 611043 --- addons/mail/mail_thread.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 384fc6d6642..5691cb9ac73 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -253,7 +253,10 @@ class mail_thread(osv.AbstractModel): # automatic logging unless asked not to (mainly for various testing purpose) if not context.get('mail_create_nolog'): - self.message_post(cr, uid, thread_id, body=_('%s created') % (self._description), context=context) + ir_model_pool = self.pool['ir.model'] + ids = ir_model_pool.search(cr, uid, [('model', '=', self._name)], context=context) + name = ir_model_pool.read(cr, uid, ids, ['name'], context=context)[0]['name'] + self.message_post(cr, uid, thread_id, body=_('%s created') % name, context=context) # auto_subscribe: take values and defaults into account create_values = dict(values)