[FIX] website_sale: prevent editor to make dirty elements
Whenever the layout of the shop when editing the /shop page, all the elements mutated from _onApplyShopLayoutChange became dirty but shouldn't have as there is no intention to save those mutations. Task-2676809 closes odoo/odoo#83398 X-original-commit: aca32bc0ab670221ea885cf8c17e7449255f1458 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
@@ -779,6 +779,10 @@ publicWidget.registry.WebsiteSaleLayout = publicWidget.Widget.extend({
|
||||
* @param {Event} ev
|
||||
*/
|
||||
_onApplyShopLayoutChange: function (ev) {
|
||||
const wysiwyg = this.options.wysiwyg;
|
||||
if (wysiwyg) {
|
||||
wysiwyg.odooEditor.observerUnactive('_onApplyShopLayoutChange');
|
||||
}
|
||||
var switchToList = $(ev.currentTarget).find('.o_wsale_apply_list input').is(':checked');
|
||||
if (!this.editableMode) {
|
||||
this._rpc({
|
||||
@@ -797,6 +801,9 @@ publicWidget.registry.WebsiteSaleLayout = publicWidget.Widget.extend({
|
||||
$grid.toggleClass('o_wsale_layout_list', switchToList);
|
||||
void $grid[0].offsetWidth;
|
||||
$grid.find('*').css('transition', '');
|
||||
if (wysiwyg) {
|
||||
wysiwyg.odooEditor.observerActive('_onApplyShopLayoutChange');
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user