diff --git a/sao/src/model.js b/sao/src/model.js index c8699ab610..46d52a9f5a 100644 --- a/sao/src/model.js +++ b/sao/src/model.js @@ -1302,12 +1302,7 @@ var values = this._get_on_change_args( Object.keys(this._changed).concat(['id'])); return this.model.execute('pre_validate', - [values], this.get_context()) - .then(function() { - return true; - }, function() { - return false; - }); + [values], this.get_context()); }, cancel: function() { this._loaded = {}; diff --git a/sao/src/window.js b/sao/src/window.js index cec0240090..2b71eea91a 100644 --- a/sao/src/window.js +++ b/sao/src/window.js @@ -430,7 +430,10 @@ this.screen.current_record) { this.screen.current_record.validate().then(function(validate) { if (validate && this.screen.attributes.pre_validate) { - return this.screen.current_record.pre_validate(); + return this.screen.current_record.pre_validate().then( + function () { return true; }, + function () { return false; } + ); } return validate; }.bind(this)).then(function(validate) {