From f1ee633f26a78636fede3e2b600c801b5f474a50 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 25 Jul 2018 11:22:17 +0200 Subject: [PATCH] [FIX] website_hr_recruitment: frontend creation ok When creating a job position from the frontend, and we: - are on the same language that the default website language, - have the permission to write on ir.ui.view, we have all conditions to adding branding used to edit a page. But when creating a position by the frontend, we create a job that will render this template: website_hr_recruitment.default_website_description When we are in the above said condition, we will create a job position that erroneously has the branding that should only be displayed on website and removed when saving an edition. This caused a lot of problem with the editor that would most often not be able to edit the content. In this commit, we use the "rendering_bundle" context key to prevent branding. opw-1868879 closes #25963 --- addons/website_hr_recruitment/controllers/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/website_hr_recruitment/controllers/main.py b/addons/website_hr_recruitment/controllers/main.py index a74fd9d4631..5741b349b5b 100644 --- a/addons/website_hr_recruitment/controllers/main.py +++ b/addons/website_hr_recruitment/controllers/main.py @@ -69,7 +69,8 @@ class WebsiteHrRecruitment(http.Controller): @http.route('/jobs/add', type='http', auth="user", website=True) def jobs_add(self, **kwargs): - job = request.env['hr.job'].create({ + # avoid branding of website_description by setting rendering_bundle in context + job = request.env['hr.job'].with_context(rendering_bundle=True).create({ 'name': _('Job Title'), }) return request.redirect("/jobs/detail/%s?enable_editor=1" % slug(job))