From 192c970da7c0d59f4386f61ca6d474ffba49a84b Mon Sep 17 00:00:00 2001 From: Sanket Brahmbhatt Date: Wed, 9 Aug 2023 16:13:30 +0530 Subject: [PATCH] [FIX] website: avoid 'NoneType' has no attribute 'context' at install When loading a registry from the route with auth="none" and where module 'website' is set as 'to install', request.env will be None, and install will crash as follows: Error:- AttributeError: 'NoneType' object has no attribute 'context' reference of previous commit- https://github.com/odoo/odoo/commit/0ebf849b8e0de33d3b6e7e06c66189591dc7a72c sentry-42474563 closes odoo/odoo#136096 X-original-commit: ca43e03e6f510520e874b2a8bba092ac9a7f2453 Signed-off-by: Romain Derie (rde) --- addons/website/models/ir_module_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/models/ir_module_module.py b/addons/website/models/ir_module_module.py index 5d2f89a23e5..8bf2c5f86ea 100644 --- a/addons/website/models/ir_module_module.py +++ b/addons/website/models/ir_module_module.py @@ -76,7 +76,7 @@ class IrModuleModule(models.Model): -> We want to upgrade every website using this theme. """ - if request and request.db and request.context.get('apply_new_theme'): + if request and request.db and request.env and request.context.get('apply_new_theme'): self = self.with_context(apply_new_theme=True) for module in self: