Do not request model notifications if they are already empty

issue11411
review388371002
This commit is contained in:
Cédric Krier
2022-04-19 23:17:51 +02:00
parent b8418e4792
commit e7b1b20e60
+2 -2
View File
@@ -555,7 +555,7 @@
Sao.common.ModelNotification = Sao.class_(Object, {
init: function() {
this._depends = {};
this._depends = null;
},
load_names: function() {
this._depends = Sao.rpc({
@@ -564,7 +564,7 @@
}, Sao.Session.current_session, false);
},
get: function(model) {
if (jQuery.isEmptyObject(this._depends)) {
if (!this._depends) {
this.load_names();
}
return this._depends[model] || [];