[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@298a9b3a94
This commit is contained in:
mgh-odoo
2019-06-27 19:59:16 +02:00
committed by Christophe Simonis
parent 0fa9c07eaa
commit c3a609eae4
@@ -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);
}
}