[IMP] website_blog: add index on website_id and is_published field

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
This commit is contained in:
Jeremy Kersten
2020-04-27 13:49:01 +00:00
co-authored by Romain Derie
parent 02abc57713
commit 1f886b72f3
+2 -1
View File
@@ -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.')