[FIX] web_editor: force widget with reload to no-preview

This commit resolves the issue that arises when a widget contains a
reload attribute but lacks a no-preview attribute. That config leads to
an "Uncaught Promise" error. With this update, when a reload attribute
is detected, the no-preview attribute is now automatically added,
preventing the error from occurring. The problem occurs since [1].

Steps to reproduce:
- Go to website
- Edit
- Click on the header
- In the navbar options, change the Mobile Alignment option.
=> Works but traceback anyway.

[1]: https://github.com/odoo/odoo/commit/fcb16a3b1bd373726ffb54f0fbe41fb6d1784769

task-3572334

closes odoo/odoo#139909

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
Serge Bayet (seba)
2023-11-02 15:10:53 +00:00
committed by qsm-odoo
parent fb8c608e3d
commit bf54de9a71
@@ -290,6 +290,9 @@ const UserValueWidget = Widget.extend({
this.illustrationEl = document.createElement('i');
this.illustrationEl.classList.add('fa', this.options.dataAttributes.icon);
}
if (this.options.dataAttributes.reload) {
this.options.dataAttributes.noPreview = "true";
}
},
/**
* @override