From 1f886b72f30ffa13a4cae29ab23b3ecd475c764c Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Thu, 23 Apr 2020 14:34:47 +0000 Subject: [PATCH] [IMP] website_blog: add index on website_id and is_published field task-2211013 Co-authored-by: Romain Derie Co-authored-by: Jeremy Kersten --- addons/website/models/mixins.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/website/models/mixins.py b/addons/website/models/mixins.py index 5f6f80695c7..ce3ba7a268d 100644 --- a/addons/website/models/mixins.py +++ b/addons/website/models/mixins.py @@ -122,6 +122,7 @@ class WebsiteMultiMixin(models.AbstractModel): string="Website", ondelete="restrict", help="Restrict publishing to this website.", + index=True, ) def can_access_from_current_website(self, website_id=False): @@ -139,7 +140,7 @@ class WebsitePublishedMixin(models.AbstractModel): _description = 'Website Published Mixin' website_published = fields.Boolean('Visible on current website', related='is_published', readonly=False) - is_published = fields.Boolean('Is Published', copy=False, default=lambda self: self._default_is_published()) + is_published = fields.Boolean('Is Published', copy=False, default=lambda self: self._default_is_published(), index=True) can_publish = fields.Boolean('Can Publish', compute='_compute_can_publish') website_url = fields.Char('Website URL', compute='_compute_website_url', help='The full URL to access the document through the website.')