[FIX] website: don't copy is_published
Before this commit, if you duplicate a published record on the website, the copy was already published, while in most of case you need to update it to adapt to the new content. There doesn't make senses to duplicate the same content on a website and let the duplicate content. Task-1930058
This commit is contained in:
@@ -73,7 +73,7 @@ class View(models.Model):
|
||||
website_specific_view = view.copy(copy_vals)
|
||||
|
||||
view._create_website_specific_pages_for_view(website_specific_view,
|
||||
view.env['website'].browse(current_website_id))
|
||||
view.env['website'].browse(current_website_id))
|
||||
|
||||
for inherit_child in view.inherit_children_ids.filter_duplicate().sorted(key=lambda v: (v.priority, v.id)):
|
||||
if inherit_child.website_id.id == current_website_id:
|
||||
@@ -167,6 +167,7 @@ class View(models.Model):
|
||||
# create new pages for this view
|
||||
page.copy({
|
||||
'view_id': new_view.id,
|
||||
'is_published': page.is_published,
|
||||
})
|
||||
|
||||
@api.model
|
||||
|
||||
@@ -840,7 +840,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')
|
||||
is_published = fields.Boolean('Is published', copy=False)
|
||||
website_url = fields.Char('Website URL', compute='_compute_website_url', help='The full URL to access the document through the website.')
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user