[FIX] tools: do not generate translations for exported records
When a record is exported, an external ID, in the form of __export__.<model>_<id> is created on this record. When the translations are generated (e.g. "synchronise terms" wizard), the translations may be duplicated for records that have been exported. If a translation is submitted before the export (when the record had no external ID yet), a new empty translation is created as the module differs in the import. Creating a new translation may be a problem as the new term (equal to the source term) will be used as the translation value. Fixes 9480
This commit is contained in:
committed by
Raphael Collet
parent
9481ee5c2f
commit
a46f8bb9c5
@@ -671,6 +671,10 @@ def trans_generate(lang, modules, cr):
|
||||
query += ' WHERE module IN %s'
|
||||
query_models += ' AND imd.module in %s'
|
||||
query_param = (tuple(modules),)
|
||||
else:
|
||||
query += ' WHERE module != %s'
|
||||
query_models += ' AND imd.module != %s'
|
||||
query_param = ('__export__',)
|
||||
query += ' ORDER BY module, model, name'
|
||||
query_models += ' ORDER BY module, model'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user