summaryrefslogtreecommitdiff
path: root/odoo/models.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-04-09 12:16:06 +0200
committerChristophe Simonis <chs@odoo.com>2019-04-09 12:16:06 +0200
commit6c8e30cae6ca5e4fe12e287ebd29d76544be57a3 (patch)
treecce147099046ba971a817b2a5b70fbd2f054c9d0 /odoo/models.py
parent288d82a67137e206d30aaf572584e99cbee997b2 (diff)
parent6d4940675f18dbb98d1f3882863ee10e7a1e3a49 (diff)
[MERGE] forward port branch saas-12.1 up to 6d4940675f1
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 6a09ce54453..b5f661e7c83 100644
--- a/odoo/models.py
+++ b/odoo/models.py
@@ -4308,11 +4308,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)