From 98cc300cec732bced04bd5b4abbe9b87def10a91 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 9 Aug 2019 07:52:25 +0000 Subject: [PATCH] [IMP] tools: ignore line number for code translations The line number was only indicative and was not used by the system. When the translations source were updated, a big part of the diff was only about the line numbers. Ignore the given res_id value and export the line at 0 When reading the po file, the res_id from the file is still read and stored in database but should be ignored closes odoo/odoo#35582 Signed-off-by: Martin Trigaux (mat) --- odoo/tools/translate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/odoo/tools/translate.py b/odoo/tools/translate.py index 36a350ddaaf..37db19b2bdb 100644 --- a/odoo/tools/translate.py +++ b/odoo/tools/translate.py @@ -748,6 +748,7 @@ class PoFileWriter: for typy, name, res_id in tnrs: if typy == 'code': code = True + res_id = 0 if isinstance(res_id, int) or res_id.isdigit(): # second term of occurrence must be a digit # occurrence line at 0 are discarded when rendered to string