diff options
| author | Olivier Dony <odo@openerp.com> | 2017-06-01 01:46:13 +0200 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2017-06-01 01:46:13 +0200 |
| commit | 5d2869cbc812f716e3115b5efb9bd1c3082f47b7 (patch) | |
| tree | 364844fc326f0d095997120d10d83e67fdf341e9 /addons/web/static/src/js/fields/abstract_field.js | |
| parent | 04111cae39e36015d3c8494f52b110ab5ab6ad80 (diff) | |
| parent | ba15df47cb25625cb0921cba554aa0879048c90a (diff) | |
[MERGE] Forward-port saas-16 up to ba15df47cb25625cb0921cba554aa0879048c90a
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'}); |
