summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorjbm-odoo <jbm@odoo.com>2019-10-09 15:01:39 +0000
committerfw-bot <otis@odoo.com>2019-10-11 09:15:09 +0000
commit3fa123d69fb5d5c1e396bd8307eedc2a3549e72c (patch)
treedde6056db4bec405c2eb69dfedfcf5b4bc3fa05b /addons/web/static/src
parent93c657914ca0529171cd3343e059f38340a2f8a9 (diff)
[FIX] web: List editable top select last row
Before this commit, when we have a list (editable top) in a form with some mandatory fields and some existing rows. If we click on 'add a line', a new empty line appear on the top, then we click on the last row, the empty row will disappear and we will have a traceback. After this commit, if we repeat this scenario, we click on the last row, we will be able to edit this last row. closes odoo/odoo#38471 X-original-commit: 996f77b03eaf6dd646b1816e7f70209d5ee6f8df Signed-off-by: jbm-odoo <jbm-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/views/list/list_editable_renderer.js2
1 files changed, 1 insertions, 1 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 60e27998f18..93bc48ca04b 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
@@ -1218,11 +1218,11 @@ ListRenderer.include({
return Promise.resolve();
}
var wrap = options.wrap === undefined ? true : options.wrap;
+ var recordID = this._getRecordID(rowIndex);
// Select the row then activate the widget in the correct cell
var self = this;
return this._selectRow(rowIndex).then(function () {
- var recordID = self._getRecordID(rowIndex);
var record = self._getRecord(recordID);
if (fieldIndex >= (self.allFieldWidgets[record.id] || []).length) {
return Promise.reject();