diff --git a/sao/src/model.js b/sao/src/model.js index 7390b74ab6..8a9c4b832f 100644 --- a/sao/src/model.js +++ b/sao/src/model.js @@ -1262,8 +1262,7 @@ var values = this._get_on_change_args( Object.keys(this.modified_fields).concat(['id'])); return this.model.execute('pre_validate', - [values], this.get_context()) - .then(() => true, () => false); + [values], this.get_context()); }, cancel: function() { this._loaded = {}; diff --git a/sao/src/window.js b/sao/src/window.js index 5aad6ede91..5e8b218c26 100644 --- a/sao/src/window.js +++ b/sao/src/window.js @@ -479,7 +479,10 @@ this.screen.current_record) { this.screen.current_record.validate().then(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; }).then(validate => {