[IMP] Form view uses a notification when a record is not found in the database
bzr revid: fme@openerp.com-
20120213123805-4dqg4oioous25nuo
expires: 2500
});
},
- notify: function(title, text) {
+ notify: function(title, text, sticky) {
+ sticky = !!sticky;
+ var opts = {};
+ if (sticky) {
+ opts.expires = false;
+ }
this.$element.notify('create', {
title: title,
text: text
- });
+ }, opts);
},
- warn: function(title, text) {
+ warn: function(title, text, sticky) {
+ sticky = !!sticky;
+ var opts = {};
+ if (sticky) {
+ opts.expires = false;
+ }
this.$element.notify('create', 'oe_notification_alert', {
title: title,
text: text
- });
+ }, opts);
}
});
on_record_loaded: function(record) {
var self = this, set_values = [];
if (!record) {
- throw new Error("Form: No record received");
+ this.do_warn("Form", "The record could not be found in the database.", true);
+ return $.Deferred().reject();
}
this.datarecord = record;