diff options
Diffstat (limited to 'addons/web/static/src/js/fields/abstract_field.js')
| -rw-r--r-- | addons/web/static/src/js/fields/abstract_field.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/addons/web/static/src/js/fields/abstract_field.js b/addons/web/static/src/js/fields/abstract_field.js index 725a237750d..d09174b2b20 100644 --- a/addons/web/static/src/js/fields/abstract_field.js +++ b/addons/web/static/src/js/fields/abstract_field.js @@ -348,8 +348,11 @@ var AbstractField = Widget.extend({ * * @private * @param {any} value + * @param {Object} [options] + * @param {boolean} [options.forceChange=false] if true, the change event will be + * triggered even if the new value is the same as the old one */ - _setValue: function (value) { + _setValue: function (value, options) { // we try to avoid doing useless work, if the value given has not // changed. Note that we compare the unparsed values. if (this.lastSetValue === value || (this.value === false && value === '')) { @@ -363,7 +366,7 @@ var AbstractField = Widget.extend({ this._isValid = false; return; } - if (this._isSameValue(value)) { + if (!(options && options.forceChange) && this._isSameValue(value)) { return; } var changes = {}; @@ -371,6 +374,7 @@ var AbstractField = Widget.extend({ this.trigger_up('field_changed', { dataPointID: this.dataPointID, changes: changes, + viewType: this.viewType, }); }, @@ -404,6 +408,9 @@ var AbstractField = Widget.extend({ ev.stopPropagation(); this.trigger_up('navigation_move', {direction: 'next_line'}); break; + case $.ui.keyCode.ESCAPE: + this.trigger_up('navigation_move', {direction: 'cancel'}); + break; case $.ui.keyCode.UP: ev.stopPropagation(); this.trigger_up('navigation_move', {direction: 'up'}); |
