summaryrefslogtreecommitdiff
path: root/odoo/models.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-04-10 15:10:24 +0200
committerChristophe Simonis <chs@odoo.com>2019-04-10 15:10:24 +0200
commite145f2b0c8831ec8756307b6b70c82f8dcdcab54 (patch)
tree93406d01e313cfecdeac03132c1cccb55ff05088 /odoo/models.py
parent3f95b074e959f0f4ac93fbf4048c0c7276f2c17a (diff)
parent2694174b410f14ca81f0681ff4ae6856ff459ced (diff)
[MERGE] forward port branch saas-12.2 up to 2694174b410
Diffstat (limited to 'odoo/models.py')
-rw-r--r--odoo/models.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/odoo/models.py b/odoo/models.py
index 7178f27f24c..8ebd58f4b1d 100644
--- a/odoo/models.py
+++ b/odoo/models.py
@@ -4311,11 +4311,12 @@ Fields:
if vals['lang'] == old.env.lang and field.translate is True:
# force a source if the new_val was not changed by copy override
if new_val == old[name]:
- vals['source'] = old_wo_lang[name]
+ new_wo_lang[name] = old_wo_lang[name]
+ vals['src'] = old_wo_lang[name]
# the value should be the new value (given by copy())
vals['value'] = new_val
vals_list.append(vals)
- Translation.create(vals_list)
+ Translation._upsert_translations(vals_list)
@api.multi
@api.returns('self', lambda value: value.id)