[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) <rco@openerp.com>
This commit is contained in:
Raphael Collet
2020-12-08 12:21:34 +00:00
parent c3c465551c
commit d2b1fb8740
+1 -1
View File
@@ -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 {