Skip to content
Snippets Groups Projects
Commit f2f45cdd authored by niyasraphy's avatar niyasraphy
Browse files

[FIX] website_blog: post_date inverse function in blog post

before this commit, on clearing the value from
post_date field in the blog.post model is
not recalculating the post_date value
from the inverse function.

* open a blog post
* clear the post date value
* click go to website smart button
* traceback will be shown due to missing date

_write is not needed because it was done for
method _compute_ranking, which doesn't exist
in v16 https://github.com/odoo/odoo/commit/74e1d6940da7b5f0cc8fe4b2ba60d0bb81990ba5



post_date is computed method with inverse
 function which is handled in write, not in _write

after this commit, on clearing post_date value
the inverse function will set the post_date
value from create date as it was in the
previous versions.

closes odoo/odoo#116922

Signed-off-by: default avatarIvan Elizaryev (iel) <iel@odoo.com>
parent 83de5424
Branches
Tags
No related merge requests found
......@@ -216,7 +216,7 @@ class BlogPost(models.Model):
for blog_post in self:
blog_post.published_date = blog_post.post_date
if not blog_post.published_date:
blog_post._write(dict(post_date=blog_post.create_date)) # dont trigger inverse function
blog_post.post_date = blog_post.create_date
def _check_for_publication(self, vals):
if vals.get('is_published'):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment