From c5d8d30faa94a57a31f7f83d75571dbbc93e0bfd Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Sat, 15 Jan 2022 18:56:35 +0000 Subject: [PATCH] [FIX] base: add missing _name for MockIrQWeb Fixup for #82838, which could cause the following crash when creating a new database from the DB manager UI, but not from the command-line: ``` Traceback (most recent call last): File "/home/odoo/15.0/odoo/service/db.py", line 63, in _initialize_db registry = odoo.modules.registry.Registry.new(db_name, demo, None, update_module=True) File "/home/odoo/15.0/odoo/modules/registry.py", line 87, in new odoo.modules.load_modules(registry, force_demo, status, update_module) File "/home/odoo/15.0/odoo/modules/loading.py", line 415, in load_modules loaded_modules, processed_modules = load_module_graph( File "/home/odoo/15.0/odoo/modules/loading.py", line 199, in load_module_graph registry.init_models(cr, model_names, {'module': package.name}, new_install) File "/home/odoo/15.0/odoo/modules/registry.py", line 427, in init_models model._auto_init() File "/home/odoo/15.0/odoo/models.py", line 2795, in _auto_init raise_on_invalid_object_name(self._name) File "/home/odoo/15.0/odoo/models.py", line 104, in raise_on_invalid_object_name raise ValueError(msg) ValueError: The _name attribute MockIrQWeb is not valid. ``` Not visible on runbot as it does not use the DB manager for creating databases. Fixes #82843 closes odoo/odoo#82853 X-original-commit: c0da3aa4812dc7be4f7ce94d771e44d093d4f612 Signed-off-by: Olivier Dony --- odoo/addons/base/models/ir_qweb.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odoo/addons/base/models/ir_qweb.py b/odoo/addons/base/models/ir_qweb.py index 72da524573f..1ee4a05dfdc 100644 --- a/odoo/addons/base/models/ir_qweb.py +++ b/odoo/addons/base/models/ir_qweb.py @@ -376,6 +376,8 @@ def render(template_name, values, load, **options): _Registry__cache = {} class MockIrQWeb(IrQWeb): + _name = 'ir.qweb.mock' + pool = MockPool() def _get_field(self, *args):