Merge lp:~savoirfairelinux-openerp/openobject-addons/7.0_mail_thread_translate_bug1262000 into lp:openobject-addons/7.0

Status: Needs review
Proposed branch: lp:~savoirfairelinux-openerp/openobject-addons/7.0_mail_thread_translate_bug1262000
Merge into: lp:openobject-addons/7.0
Diff against target: 12 lines (+1/-1)
1 file modified
mail/mail_thread.py (+1/-1)
To merge this branch: bzr merge lp:~savoirfairelinux-openerp/openobject-addons/7.0_mail_thread_translate_bug1262000
Reviewer Review Type Date Requested Status
Martin Trigaux (OpenERP) (community) Disapprove
OpenERP Core Team Pending
Review via email: mp+199374@code.launchpad.net

Description of the change

Fix for bug #1262000 in which OEChatter's mail_thread widget does not translate the object's _description field resulting in half-translated messages posted in the mail thread.

Simple line change which translates self._description when invoked here.

To post a comment you must log in.
Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

Can someone review this, please.
It is a very simple fix for a pretty obvious translation bug.

Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Hello,

This may work for some models by some but _description is not translated by default. Fixing it this way will not be coherent. By luck you may have translation for res.groups but not others.
Without having a better solution (such as translating by default _description, which should be discussed), it's a limitation of the framework that we do no translate this.
In other models we use the subtypes (eg: project.task) which are translated.

Regards

review: Disapprove
Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

@Martin
This was discussed in the ocb MP, the following MP for openobject-server guarentees that _description is exported in the translation files:

https://code.launchpad.net/~savoirfairelinux-openerp/openobject-server/7.0_mail_thread_translate_bug1262000/+merge/208812

Unmerged revisions

9702. By Sandy Carter (http://www.savoirfairelinux.com)

[FIX] Have object description translated when posting OEChatter 'created' message (Bug #1262000)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mail/mail_thread.py'
2--- mail/mail_thread.py 2013-12-09 09:09:03 +0000
3+++ mail/mail_thread.py 2013-12-17 23:50:58 +0000
4@@ -242,7 +242,7 @@
5
6 # automatic logging unless asked not to (mainly for various testing purpose)
7 if not context.get('mail_create_nolog'):
8- self.message_post(cr, uid, thread_id, body=_('%s created') % (self._description), context=context)
9+ self.message_post(cr, uid, thread_id, body=_('%s created') % (_(self._description)), context=context)
10
11 # subscribe uid unless asked not to
12 if not context.get('mail_create_nosubscribe'):