[FIX] incorrect newapi migration in website_blog

Leads to the Duplicate link (when editing a blog post in website)
yielding a 500 Internal Error instead of duplicating the blog post.

OPW-740308

Fixes #16511
This commit is contained in:
xmo-odoo
2017-04-20 09:38:50 +02:00
committed by GitHub
parent 5ed198294f
commit ed2bc6dbc3
+1 -1
View File
@@ -322,7 +322,7 @@ class WebsiteBlog(http.Controller):
:return redirect to the new blog created
"""
new_blog_post = request.env['blog.post'].with_context(mail_create_nosubscribe=True).copy(int(blog_post_id), {})
new_blog_post = request.env['blog.post'].with_context(mail_create_nosubscribe=True).browse(int(blog_post_id)).copy()
return werkzeug.utils.redirect("/blog/%s/post/%s?enable_editor=1" % (slug(new_blog_post.blog_id), slug(new_blog_post)))
@http.route('/blog/post_get_discussion/', type='json', auth="public", website=True)