[FIX] tools: avoid updating translation of '__export__' module
If translation of '__export__' module record's source and translated value in 'en_US' language is different. In that case, record's value of en_US lang is translated value. Also in most of the case export module records are set as noupdate false due to this while upgrading the database to version 16 from lower version, the record's value is changed to their source value for 'en_US' lang. To avoid this problem of updating a record's value, this PR will not considering '__export__' module records for translation updates. Hence,'__export__' module's records translation remain same as per original database. Task : 3626386 closes odoo/odoo#148757 X-original-commit: 29341902bd6b6b7ff84eede2651251f6d2ce2faa Signed-off-by: Raphael Collet <rco@odoo.com>
This commit is contained in:
@@ -1725,7 +1725,7 @@ def _get_translation_upgrade_queries(cr, field):
|
||||
SELECT it.res_id as res_id, jsonb_object_agg(it.lang, it.value) AS value, bool_or(imd.noupdate) AS noupdate
|
||||
FROM _ir_translation it
|
||||
LEFT JOIN ir_model_data imd
|
||||
ON imd.model = %s AND imd.res_id = it.res_id
|
||||
ON imd.model = %s AND imd.res_id = it.res_id AND imd.module != '__export__'
|
||||
WHERE it.type = 'model' AND it.name = %s AND it.state = 'translated'
|
||||
GROUP BY it.res_id
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user