[FIX] core: fix import error after translate override
When a model_terms translated field is overridden to a model translated field. Its terms in the po files should be ignored otherwise calling field.translate which is boolean will cause error. opw-3644158 closes odoo/odoo#148518 X-original-commit: 50b314ff3c5d5003ad570d29a05bacd832d70362 Signed-off-by: Raphael Collet <rco@odoo.com> Signed-off-by: Chong Wang (cwg) <cwg@odoo.com>
This commit is contained in:
@@ -1369,9 +1369,9 @@ class TranslationImporter:
|
||||
xmlid = module_name + '.' + row['imd_name']
|
||||
if xmlids and xmlid not in xmlids:
|
||||
continue
|
||||
if row.get('type') == 'model':
|
||||
if row.get('type') == 'model' and field.translate is True:
|
||||
self.model_translations[model_name][field_name][xmlid][lang] = row['value']
|
||||
elif row.get('type') == 'model_terms':
|
||||
elif row.get('type') == 'model_terms' and callable(field.translate):
|
||||
self.model_terms_translations[model_name][field_name][xmlid][row['src']][lang] = row['value']
|
||||
|
||||
def save(self, overwrite=False, force_overwrite=False):
|
||||
|
||||
Reference in New Issue
Block a user