[IMP] Renamed Notification methods 'default' -> notify , 'alert' -> warn
bzr revid: fme@openerp.com-20110411083032-zc87gltpnw2z7s0r
This commit is contained in:
parent
c05b34c409
commit
bc82a989f2
|
@ -245,12 +245,7 @@ openerp.base.Notification = openerp.base.BasicController.extend({
|
||||||
text: text
|
text: text
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// TODO remove to avoid default as attribute
|
warn: function(title, text) {
|
||||||
'default': function(title, text) {
|
|
||||||
this.notify(title,text);
|
|
||||||
},
|
|
||||||
// TODO change into warn to avoid alert
|
|
||||||
alert: function(title, text) {
|
|
||||||
this.$element.notify('create', 'oe_notification_alert', {
|
this.$element.notify('create', 'oe_notification_alert', {
|
||||||
title: title,
|
title: title,
|
||||||
text: text
|
text: text
|
||||||
|
@ -907,7 +902,7 @@ openerp.base.WebClient = openerp.base.Controller.extend({
|
||||||
this.header.start();
|
this.header.start();
|
||||||
this.login.start();
|
this.login.start();
|
||||||
this.menu.start();
|
this.menu.start();
|
||||||
this.notification['default']("OpenERP Client", "The openerp client has been initialized.");
|
this.notification.notify("OpenERP Client", "The openerp client has been initialized.");
|
||||||
},
|
},
|
||||||
on_logged: function() {
|
on_logged: function() {
|
||||||
this.action = new openerp.base.ActionManager(this.session, "oe_app");
|
this.action = new openerp.base.ActionManager(this.session, "oe_app");
|
||||||
|
|
|
@ -100,7 +100,7 @@ openerp.base.DataSet = openerp.base.Controller.extend( /** @lends openerp.base.
|
||||||
}, callback);
|
}, callback);
|
||||||
},
|
},
|
||||||
unlink: function(ids) {
|
unlink: function(ids) {
|
||||||
this.notification['default']("Unlink", ids);
|
this.notification.notify("Unlink", ids);
|
||||||
},
|
},
|
||||||
call: function (method, ids, args, callback) {
|
call: function (method, ids, args, callback) {
|
||||||
ids = ids || [];
|
ids = ids || [];
|
||||||
|
|
|
@ -234,24 +234,24 @@ openerp.base.FormView = openerp.base.Controller.extend( /** @lends openerp.base
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
msg += "</ul>";
|
msg += "</ul>";
|
||||||
this.notification.alert("The following fields are invalid :", msg);
|
this.notification.warn("The following fields are invalid :", msg);
|
||||||
},
|
},
|
||||||
on_saved: function(r) {
|
on_saved: function(r) {
|
||||||
if (!r.result) {
|
if (!r.result) {
|
||||||
this.log("Record was not saved");
|
this.log("Record was not saved");
|
||||||
} else {
|
} else {
|
||||||
// Check response for exceptions, display error
|
// Check response for exceptions, display error
|
||||||
this.notification['default']("Record saved", "The record #" + this.datarecord.id + " has been saved.");
|
this.notification.notify("Record saved", "The record #" + this.datarecord.id + " has been saved.");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
do_search: function (domains, contexts, groupbys) {
|
do_search: function (domains, contexts, groupbys) {
|
||||||
this.notification['default']("Searching form");
|
this.notification.notify("Searching form");
|
||||||
},
|
},
|
||||||
on_action: function (action) {
|
on_action: function (action) {
|
||||||
this.notification['default']('Executing action ' + action);
|
this.notification.notify('Executing action ' + action);
|
||||||
},
|
},
|
||||||
do_cancel: function () {
|
do_cancel: function () {
|
||||||
this.notification['default']("Cancelling form");
|
this.notification.notify("Cancelling form");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -720,7 +720,7 @@ openerp.base.form.FieldOne2ManyDatasSet = openerp.base.DataSetStatic.extend({
|
||||||
this._super(id, data, callback);
|
this._super(id, data, callback);
|
||||||
},
|
},
|
||||||
unlink: function() {
|
unlink: function() {
|
||||||
this.notification['default']('Unlinking o2m ' + this.ids);
|
this.notification.notify('Unlinking o2m ' + this.ids);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -215,7 +215,7 @@ openerp.base.SearchView = openerp.base.Controller.extend({
|
||||||
* @param {Array} errors a never-empty array of error objects
|
* @param {Array} errors a never-empty array of error objects
|
||||||
*/
|
*/
|
||||||
on_invalid: function (errors) {
|
on_invalid: function (errors) {
|
||||||
this.notification['default']("Invalid Search", "triggered from search view");
|
this.notification.notify("Invalid Search", "triggered from search view");
|
||||||
},
|
},
|
||||||
do_clear: function (e) {
|
do_clear: function (e) {
|
||||||
if (e && e.preventDefault) { e.preventDefault(); }
|
if (e && e.preventDefault) { e.preventDefault(); }
|
||||||
|
|
Loading…
Reference in New Issue