[FIX] base: upsert empty translations

If a translation has an empty src and value, the value in the dictionary
after the search_read is False, not ''
When doing an insert, False is converted to 'false'

Before 489494e733 the translations were inserted using the ORM which correctly
converts False to ''

opw-1999723

closes odoo/odoo#33649

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
Martin Trigaux
2019-05-24 13:34:07 +00:00
parent f58668ccb5
commit b45236dd68
+2 -2
View File
@@ -681,8 +681,8 @@ class IrTranslation(models.Model):
rows_by_type = defaultdict(list)
for vals in vals_list:
rows_by_type[vals['type']].append((
vals['name'], vals['lang'], vals['res_id'], vals['src'], vals['type'],
vals.get('module'), vals['value'], vals.get('state'), vals.get('comments'),
vals['name'], vals['lang'], vals['res_id'], vals['src'] or '', vals['type'],
vals.get('module'), vals['value'] or '', vals.get('state'), vals.get('comments'),
))
if rows_by_type['model']: