From d2b1fb87409277afda0f9a9a2e1ae1217f87ce45 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Tue, 8 Dec 2020 09:02:58 +0000 Subject: [PATCH] [FIX] core: parsing of external ids in PO files The parsing of external ids was made with the regexp `(\w+)\.([\w-]+)`. This regexp is inadequate for external ids that contain non-alphanumeric characters like. We have such a use-case with the selections of field `rating_operator` in module `sale_subscription` that uses the values `">"` and `"<"`. The fix consists in replacing the regexp by `(\w+)\.([^ ]+)`. closes odoo/odoo#63017 X-original-commit: 52bf0e331fb9230423b76b9014bb13d490930e76 Related: odoo/enterprise#15189 Signed-off-by: Raphael Collet (rco) --- odoo/tools/translate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/tools/translate.py b/odoo/tools/translate.py index 0fb19676056..36d225c8093 100644 --- a/odoo/tools/translate.py +++ b/odoo/tools/translate.py @@ -656,7 +656,7 @@ class PoFileReader: translation = entry.msgstr found_code_occurrence = False for occurrence, line_number in entry.occurrences: - match = re.match(r'(model|model_terms):([\w.]+),([\w]+):(\w+)\.([\w-]+)', occurrence) + match = re.match(r'(model|model_terms):([\w.]+),([\w]+):(\w+)\.([^ ]+)', occurrence) if match: type, model_name, field_name, module, xmlid = match.groups() yield {