summaryrefslogtreecommitdiff
path: root/addons/mail/models/mail_thread.py
diff options
context:
space:
mode:
authorTatiana Deribina <deribina@itlibertas.com>2019-07-31 11:36:59 +0000
committerMartin Trigaux <mat@odoo.com>2019-08-01 12:48:22 +0000
commite08f706b11fddce1a067d5d6bcc13ec3cd1dec1c (patch)
tree7fd7cdbcfbc8bd293905b357efdd2ffde2393590 /addons/mail/models/mail_thread.py
parent659aa432aaaf5a337dc73575fe55365e8d72784d (diff)
[FIX] mail: translate message of copied object
When duplicating a record, the language is set to None in the context when copying a record new = self.with_context(lang=None).create(vals) self.with_context(from_copy_translation=True).copy_translations(new, excluded=default or ()) In mail.thread, the usecase of no language in the context was considered if 'lang' not in self._context: track_threads = threads.with_context(lang=self.env.user.lang) but not the case of a language explicitly set to None This means that, when duplicating a record, the tracked fields mesages were untranslated. Fixes odoo/odoo#35213 Closes odoo/odoo#35331 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Diffstat (limited to 'addons/mail/models/mail_thread.py')
-rw-r--r--addons/mail/models/mail_thread.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py
index 8ab60dbbb1c..cf081635fde 100644
--- a/addons/mail/models/mail_thread.py
+++ b/addons/mail/models/mail_thread.py
@@ -288,7 +288,7 @@ class MailThread(models.AbstractModel):
# track values
if not self._context.get('mail_notrack'):
- if 'lang' not in self._context:
+ if not self._context.get('lang'):
track_threads = threads.with_context(lang=self.env.user.lang)
else:
track_threads = threads