diff options
| author | mgh-odoo <mgh@odoo.com> | 2019-06-26 05:04:21 +0000 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-06-27 19:59:16 +0200 |
| commit | c3a609eae4ff5396c1814228d3fc75623ab21b49 (patch) | |
| tree | 082a622102976535d7ce5750c740cf994c3e87ba | |
| parent | 0fa9c07eaa2c8d66ccf7a3d19a35efd1bf2698dc (diff) | |
[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) <qsm@odoo.com>
X-port/Cherry-pick of odoo/enterprise@298a9b3a943dc64709bdbd67cbdfafc84f7e72f4
| -rw-r--r-- | addons/website_form/static/src/js/website_form_editor.js | 4 |
1 files changed, 4 insertions, 0 deletions
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); } } |
