From c3a609eae4ff5396c1814228d3fc75623ab21b49 Mon Sep 17 00:00:00 2001 From: mgh-odoo Date: Wed, 26 Jun 2019 05:04:21 +0000 Subject: [PATCH] [FIX] website_form_editor: retain selection field design while saving In case of selection or many2one field, while saving the page, the field is re-rendered and loses the applied design changes. This commit fixes the behavior by re-applying those changes on a newly rendered field. task-1961733 closes odoo/enterprise#4657 Signed-off-by: Quentin Smetz (qsm) X-port/Cherry-pick of odoo/enterprise@298a9b3a943dc64709bdbd67cbdfafc84f7e72f4 --- addons/website_form/static/src/js/website_form_editor.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/website_form/static/src/js/website_form_editor.js b/addons/website_form/static/src/js/website_form_editor.js index 6ee47ab707d..5acaf0df0d6 100644 --- a/addons/website_form/static/src/js/website_form_editor.js +++ b/addons/website_form/static/src/js/website_form_editor.js @@ -484,6 +484,10 @@ odoo.define('website_form_editor', function (require) { if (this.$target.hasClass('o_website_form_field_hidden')) { $new_select.addClass('o_website_form_field_hidden'); } + var labelClasses = this.$target.find('> div:first').attr('class'); + var inputClasses = this.$target.find('> div:last').attr('class'); + $new_select.find('> div:first').attr('class', labelClasses); + $new_select.find('> div:last').attr('class', inputClasses); this.$target.replaceWith($new_select); } }