diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-04-09 20:48:01 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-04-09 20:48:01 +0200 |
| commit | c9e1deb496e97fca22991b788ad36f753ecb1fc5 (patch) | |
| tree | 78689bb9e5e029c99a2f1690e7e9d8e425734a26 /addons/web/static/src | |
| parent | 6c8e30cae6ca5e4fe12e287ebd29d76544be57a3 (diff) | |
| parent | af313858b4bfcaa726c4d08057a1ff1db1ade480 (diff) | |
[MERGE] forward port branch saas-12.1 up to af313858b4b
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/list/list_editable_renderer.js | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/addons/web/static/src/js/views/list/list_editable_renderer.js b/addons/web/static/src/js/views/list/list_editable_renderer.js index 185a385a812..04da1bc4983 100644 --- a/addons/web/static/src/js/views/list/list_editable_renderer.js +++ b/addons/web/static/src/js/views/list/list_editable_renderer.js @@ -428,6 +428,18 @@ ListRenderer.include({ }); } }, + /** + * @override + */ + updateState: function (state, params) { + if (params.noRender) { + // the state changed, but we won't do a re-rendering right now, so + // remove computed modifiers data (as they are obsolete) to force + // them to be recomputed at next (sub-)rendering + this.allModifiersData = []; + } + return this._super.apply(this, arguments); + }, //-------------------------------------------------------------------------- // Private @@ -478,7 +490,8 @@ ListRenderer.include({ */ _moveToPreviousLine: function () { if (this.currentRow > 0) { - this._selectCell(this.currentRow - 1, this.columns.length - 1); + // FORWARD-PORT THIS COMMIT UP TO SAAS-12.2 + this._selectCell(this.currentRow - 1, this.columns.length - 1, {inc: -1}); } else { this.unselectRow().then(this.trigger_up.bind(this, 'add_record')); } @@ -692,6 +705,8 @@ ListRenderer.include({ * @param {boolean} [options.force=false] if true, force selecting the cell * even if seems to be already the selected one (useful after a re- * rendering, to reset the focus on the correct field) + * @param {integer} [options.inc=1] the increment to use when searching for + * the "next" possible cell (if the cell to select can't be selected) * @return {Deferred} fails if no cell could be selected */ _selectCell: function (rowIndex, fieldIndex, options) { @@ -715,7 +730,7 @@ ListRenderer.include({ var oldFieldIndex = self.currentFieldIndex; self.currentFieldIndex = fieldIndex; fieldIndex = self._activateFieldWidget(record, fieldIndex, { - inc: 1, + inc: options.inc || 1, wrap: wrap, event: options && options.event, }); @@ -868,7 +883,7 @@ ListRenderer.include({ switch (ev.data.direction) { case 'previous': if (this.currentFieldIndex > 0) { - this._selectCell(this.currentRow, this.currentFieldIndex - 1, {wrap: false}) + this._selectCell(this.currentRow, this.currentFieldIndex - 1, {inc: -1, wrap: false}) .fail(this._moveToPreviousLine.bind(this)); } else { this._moveToPreviousLine(); |
