summaryrefslogtreecommitdiff
path: root/addons/website/models/ir_ui_view.py
diff options
context:
space:
mode:
authorRaphael Collet <rco@odoo.com>2020-04-07 13:51:30 +0000
committerRaphael Collet <rco@odoo.com>2020-05-18 09:51:43 +0000
commitea3e39506a2b360545ec0cd1d3235e69ad16ea6c (patch)
tree9d103c7a40911c988e1a3cbecfd8d6a76a3a9a85 /addons/website/models/ir_ui_view.py
parent2e56191c8b86d05bbce17790de8a4732c0478013 (diff)
[IMP] models: use slots for BaseModel
This restricts the attributes of a BaseModel instance to `env`, `_ids` and `_prefetch_ids`. This way, one can only assign fields on a record; other assignments are programming errors. This also reduces the memory footprint of records from 168 to 64 bytes (-62%), and makes their instanciation faster. closes odoo/odoo#51075 Related: odoo/enterprise#10529 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'addons/website/models/ir_ui_view.py')
-rw-r--r--addons/website/models/ir_ui_view.py4
1 files changed, 0 insertions, 4 deletions
diff --git a/addons/website/models/ir_ui_view.py b/addons/website/models/ir_ui_view.py
index 8fa24631d26..4b6cd55551b 100644
--- a/addons/website/models/ir_ui_view.py
+++ b/addons/website/models/ir_ui_view.py
@@ -405,10 +405,6 @@ class View(models.Model):
func = getattr(values['main_object'], 'get_backend_menu_id', False)
values['backend_menu_id'] = func and func() or self.env.ref('website.menu_website_configuration').id
- # Fallback incase main_object dont't inherit 'website.seo.metadata'
- if not hasattr(values['main_object'], 'get_website_meta'):
- values['main_object'].get_website_meta = lambda: {}
-
if self._context != new_context:
self = self.with_context(new_context)
return super(View, self)._render(values, engine=engine, minimal_qcontext=minimal_qcontext)