summaryrefslogtreecommitdiff
path: root/addons/website/models/website.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/website.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/website.py')
-rw-r--r--addons/website/models/website.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/website/models/website.py b/addons/website/models/website.py
index e079d6f12d2..41565fb031a 100644
--- a/addons/website/models/website.py
+++ b/addons/website/models/website.py
@@ -1011,3 +1011,8 @@ class BaseModel(models.AbstractModel):
return self.website_id._get_http_domain()
else:
return super(BaseModel, self).get_base_url()
+
+ def get_website_meta(self):
+ # dummy version of 'get_website_meta' above; this is a graceful fallback
+ # for models that don't inherit from 'website.seo.metadata'
+ return {}