From b45236dd688d7b7054412ae96d755a03a7590b91 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 24 May 2019 13:21:29 +0000 Subject: [PATCH] [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 489494e7339 the translations were inserted using the ORM which correctly converts False to '' opw-1999723 closes odoo/odoo#33649 Signed-off-by: Martin Trigaux (mat) --- odoo/addons/base/models/ir_translation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/odoo/addons/base/models/ir_translation.py b/odoo/addons/base/models/ir_translation.py index 09b344be2a1..15b0c2a1b2c 100644 --- a/odoo/addons/base/models/ir_translation.py +++ b/odoo/addons/base/models/ir_translation.py @@ -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']: