From ed2bc6dbc3edbbe8205cb095473ee765f21360b5 Mon Sep 17 00:00:00 2001 From: xmo-odoo Date: Thu, 20 Apr 2017 09:38:50 +0200 Subject: [PATCH] [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 --- addons/website_blog/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_blog/controllers/main.py b/addons/website_blog/controllers/main.py index a466dcf3701..23af55a997e 100644 --- a/addons/website_blog/controllers/main.py +++ b/addons/website_blog/controllers/main.py @@ -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)