[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:
Jeremy Kersten
2019-01-22 16:38:48 +00:00
parent d794cd616b
commit 9cfd1eefd8
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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
+1 -1
View File
@@ -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