Cédric Krier pushed to branch branch/default at Tryton / Tryton
Commits: 2e62e2dc by Nicolas Évrard at 2023-01-25T15:14:26+01:00 Use a promise based API for Record.pre_validate() Closes #12039 - - - - - 80d4204b by Nicolas Évrard at 2023-01-26T22:46:53+01:00 Use arrow functions in Sao.Window.Form.response - - - - - 2 changed files: - sao/src/model.js - sao/src/window.js Changes: ===================================== 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 = {}; ===================================== sao/src/window.js ===================================== @@ -479,7 +479,8 @@ 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( + () => true, () => false); } return validate; }).then(validate => { View it on Heptapod: https://foss.heptapod.net/tryton/tryton/-/compare/c0fc26c0c698ef3e41acb7dbc3cfd5f8e1fc58ce...80d4204be95cc679137e559e485440fa7b370a1c -- View it on Heptapod: https://foss.heptapod.net/tryton/tryton/-/compare/c0fc26c0c698ef3e41acb7dbc3cfd5f8e1fc58ce...80d4204be95cc679137e559e485440fa7b370a1c You're receiving this email because of your account on foss.heptapod.net.