summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2017-04-29 13:37:48 +0200
committerGéry Debongnie <ged@odoo.com>2017-05-02 09:12:41 +0200
commit6f0be0dfcacf35239cfd78e5b340a91a1d22ebfc (patch)
treed8d9239450fa4a2344755cb1c2a4df5ea9697f61 /addons/web/static/src/js
parent5a58cb281708542d3bf1f8d3d62f18cb54cc8fa6 (diff)
[FIX] web: prevent crash in some cases in list editable
Before this commit, when we moved from one line to the next, we did not wait for the unselectRow to end. This means that if the read (from the unselect row) completes after the default_get, the list renderer was not in a coherent state (currentRow was set to null), which could (and did) cause a crash. This was found by pressing the TAB key a few times, and editing some values. Also, we slightly improved the logging in the mock server. Before this, the responses from the mock server did not show from which route it came from. But in this test, we specifically make sure that the rpcs complete in a different order, so it was not really optimal.
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/views/list/list_editable_renderer.js5
1 files changed, 3 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 151d41e2e97..f9468418b9b 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
@@ -256,8 +256,9 @@ ListRenderer.include({
if (this.currentRow < this.state.data.length - 1) {
this._selectCell(this.currentRow + 1, 0);
} else {
- this._unselectRow();
- this.trigger_up('add_record');
+ this._unselectRow().then(
+ this.trigger_up.bind(this, 'add_record')
+ );
}
},
/**