[IMP] website: make is_view_active a model method

`is_view_active` relies on the `website` specified in the context.

This commit turns `is_view_active` to a model method, to avoid that its
callers think the `website` on which it is called is the one used.

closes odoo/odoo#103126

X-original-commit: 52d436706bf650bb14f2bc2a398d107ff99f81ea
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit is contained in:
Benoit Socias
2022-10-12 10:34:48 +02:00
parent 6d3c78fe30
commit 7fff7ff584
+1
View File
@@ -1037,6 +1037,7 @@ class Website(models.Model):
raise ValueError('No record found for unique ID %s. It may have been deleted.' % (view_id))
return view
@api.model
@tools.ormcache_context('key', keys=('website_id',))
def is_view_active(self, key):
"""