[FIX] web_editor: fix apply-to methods not being awaited
When the apply-to data attribute was first introduced, a mistake was made when storing the results of the methods calls, using _.each instead of _.map to associate each target element with the promise of the method execution, as a result, Promise.all would resolve immediately instead of waiting. While there are no currently documented bug caused by this, they are just waiting to happen. This commit fixes that. closes odoo/odoo#44988 X-original-commit: 32271be1f696c11b3e5157426b8f7c9efa93134b Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
@@ -2059,7 +2059,7 @@ const SnippetOptionWidget = Widget.extend({
|
||||
|
||||
if (params.applyTo) {
|
||||
const $subTargets = this.$(params.applyTo);
|
||||
const proms = _.each($subTargets, subTargetEl => {
|
||||
const proms = _.map($subTargets, subTargetEl => {
|
||||
const proxy = createPropertyProxy(this, '$target', $(subTargetEl));
|
||||
return this[methodName].call(proxy, previewMode, widgetValue, params);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user