Skip to content

Commit f24d93b

Browse files
[IMP] web_form_banner: apply banner in edit mode
1 parent 9ea4408 commit f24d93b

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

web_form_banner/static/src/js/web_form_banner.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,25 @@ odoo.define("web_form_banner.save_plus_load", function (require) {
4040
});
4141
}
4242

43+
function withRefresh(ctrl, superFn, args) {
44+
var p = superFn.apply(ctrl, args);
45+
return p.then(function () {
46+
refreshBanners(ctrl);
47+
});
48+
}
49+
4350
FormController.include({
4451
start: function () {
45-
var p = this._super.apply(this, arguments);
46-
var self = this;
47-
return p.then(function () {
48-
refreshBanners(self);
49-
});
52+
return withRefresh(this, this._super, arguments);
5053
},
5154
reload: function () {
52-
var p = this._super.apply(this, arguments);
53-
var self = this;
54-
return p.then(function () {
55-
refreshBanners(self);
56-
});
55+
return withRefresh(this, this._super, arguments);
5756
},
5857
saveRecord: function () {
59-
var self = this;
60-
return this._super.apply(this, arguments).then(function () {
61-
refreshBanners(self);
62-
});
58+
return withRefresh(this, this._super, arguments);
59+
},
60+
update: function (params, options) {
61+
return withRefresh(this, this._super, arguments);
6362
},
6463
});
6564
});

0 commit comments

Comments
 (0)