summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-04-10 15:10:24 +0200
committerChristophe Simonis <chs@odoo.com>2019-04-10 15:10:24 +0200
commite145f2b0c8831ec8756307b6b70c82f8dcdcab54 (patch)
tree93406d01e313cfecdeac03132c1cccb55ff05088 /addons/web/static/src/js
parent3f95b074e959f0f4ac93fbf4048c0c7276f2c17a (diff)
parent2694174b410f14ca81f0681ff4ae6856ff459ced (diff)
[MERGE] forward port branch saas-12.2 up to 2694174b410
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/views/list/list_editable_renderer.js18
1 files changed, 16 insertions, 2 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 9f37fcecbea..2bd9b5cc4b1 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
@@ -435,6 +435,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
@@ -955,6 +967,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 {Promise} fails if no cell could be selected
*/
_selectCell: function (rowIndex, fieldIndex, options) {
@@ -979,7 +993,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,
});
@@ -1183,7 +1197,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})
.guardedCatch(this._moveToPreviousLine.bind(this));
} else {
this._moveToPreviousLine();