From 5bc83b046a28f010ef1d19bbccadfb0337f3da53 Mon Sep 17 00:00:00 2001 From: "Abdelouahab (abla)" Date: Mon, 4 Jul 2022 09:35:00 +0000 Subject: [PATCH] [FIX] base : fix importing file with special character To reproduce ============ for example on accounting, attempt to import a record from excel containing a special character like `%`. Gets error stating the system doesn't support these Purpose ======= the issue is caused by misfromatted error string : https://github.com/odoo/odoo/blob/b859d78c3d56526f44fbdd9ce5e84d34cf8a0a35/odoo/addons/base/models/ir_fields.py#L410-L411 Specification ============= to solve the issue use : `str(value).replace('%', '%%')` opw-2838573 closes odoo/odoo#96336 X-original-commit: eb0152d4c5ec38c33ccc5381d1277543354e3456 Signed-off-by: abla001 --- odoo/addons/base/models/ir_fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/models/ir_fields.py b/odoo/addons/base/models/ir_fields.py index 7aebaea26f2..362ec117252 100644 --- a/odoo/addons/base/models/ir_fields.py +++ b/odoo/addons/base/models/ir_fields.py @@ -408,7 +408,7 @@ class IrFieldsConverter(models.AbstractModel): if len(ids) > 1: warnings.append(ImportWarning( _(u"Found multiple matches for value '%s' in field '%%(field)s' (%d matches)") - % (value, len(ids)))) + %(str(value).replace('%', '%%'), len(ids)))) id, _name = ids[0] else: name_create_enabled_fields = self.env.context.get('name_create_enabled_fields') or {}