[FIX] web: avoid calling getContext twice

Also, slightly improve the style...
This commit is contained in:
Géry Debongnie
2017-04-11 19:44:38 +02:00
committed by Aaron Bohy
parent ecceee639e
commit 086a04fdec
@@ -137,7 +137,9 @@ var FieldManagerMixin = {
* appropriate context with the route arguments' one.
*/
_onCallService: function (e) {
if (e.data.service !== "ajax" || e.data.method !== "rpc") return;
if (e.data.service !== "ajax" || e.data.method !== "rpc") {
return;
}
var args = e.data.args[1];
var options = e.data.args[2];
@@ -148,6 +150,8 @@ var FieldManagerMixin = {
}),
args.kwargs.context || {}
);
// to prevent doing this work again, in some other widget with FMM.
delete options.dataPointID;
}
},
};