From 307a2e03634b53404bb6fa4bca5c2d55e0a53e60 Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Wed, 15 Nov 2023 08:25:29 +0100 Subject: [PATCH] [FIX] base_import_module: no spaces in ir_model_data name When we are importing a module and we need to create an attachment from a file in static. We get an error if the file path of the file contains a space. We get this error becuase it takes the path to generate an xml id and the name of an xml_id cannot contains spaces. closes odoo/odoo#142113 Signed-off-by: Pierre Masereel (pim) --- addons/base_import_module/models/ir_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/base_import_module/models/ir_module.py b/addons/base_import_module/models/ir_module.py index ee23e04474d..2a18636b015 100644 --- a/addons/base_import_module/models/ir_module.py +++ b/addons/base_import_module/models/ir_module.py @@ -148,7 +148,7 @@ class IrModule(models.Model): else: attachment = IrAttachment.create(values) self.env['ir.model.data'].create({ - 'name': f"attachment_{url_path}".replace('.', '_'), + 'name': f"attachment_{url_path}".replace('.', '_').replace(' ', '_'), 'model': 'ir.attachment', 'module': module, 'res_id': attachment.id,