[FIX] website_blog: copy dict correctly
The 'copy_vals' dict would refer to the same 'vals' dict since list are mutables. This was not the expected behavior.
This commit is contained in:
@@ -209,7 +209,7 @@ class BlogPost(models.Model):
|
||||
def write(self, vals):
|
||||
result = True
|
||||
for post in self:
|
||||
copy_vals = vals
|
||||
copy_vals = dict(vals)
|
||||
if 'website_published' in vals and 'published_date' not in vals and post.published_date <= fields.Datetime.now():
|
||||
copy_vals['published_date'] = vals['website_published'] and fields.Datetime.now() or False
|
||||
result &= super(BlogPost, self).write(copy_vals)
|
||||
|
||||
Reference in New Issue
Block a user