From a46f8bb9c502c9e82fb1392aeb6120eaeb8d98bf Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 21 Jan 2016 16:21:31 +0530 Subject: [PATCH] [FIX] tools: do not generate translations for exported records When a record is exported, an external ID, in the form of __export__._ 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 --- openerp/tools/translate.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openerp/tools/translate.py b/openerp/tools/translate.py index 83710cca956..794f0d3aed7 100644 --- a/openerp/tools/translate.py +++ b/openerp/tools/translate.py @@ -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'