summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-05-03 16:25:17 +0200
committerChristophe Simonis <chs@odoo.com>2018-05-03 16:25:17 +0200
commit4b7f4f32ea6ec0d9a0a770d3095c8c2f2e112827 (patch)
treeff301c47c828b5f1732175c25e16234ef399d472 /addons/web/static/src/js
parent78ce64a6a79a41e673196939f2bb60a44db27f55 (diff)
parentf12daec1a1dba46ec4e26ce7c313bc132f9537f8 (diff)
[MERGE] forward port branch 9.0 up to f12daec1a1d
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/views/list_view.js8
-rw-r--r--addons/web/static/src/js/views/list_view_editable.js11
2 files changed, 18 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/list_view.js b/addons/web/static/src/js/views/list_view.js
index 8928b74a2c7..0c3abd29ad7 100644
--- a/addons/web/static/src/js/views/list_view.js
+++ b/addons/web/static/src/js/views/list_view.js
@@ -315,7 +315,7 @@ var ListView = View.extend({
this._limit = new_state.limit;
this.current_min = new_state.current_min;
- this.reload_content().then(function() {
+ this.reload_content_when_ready().then(function() {
// Reset the scroll position to the top on page changed only
if (!limit_changed) {
self.set_scrollTop(0);
@@ -452,6 +452,12 @@ var ListView = View.extend({
});
return reloaded.promise();
}),
+ /**
+ * Proxy allowing override when reload_content can't be called directly
+ */
+ reload_content_when_ready: function() {
+ return this.reload_content.apply(this, arguments);
+ },
reload: function () {
return this.reload_content();
},
diff --git a/addons/web/static/src/js/views/list_view_editable.js b/addons/web/static/src/js/views/list_view_editable.js
index 42987a64af1..8b00fc87ead 100644
--- a/addons/web/static/src/js/views/list_view_editable.js
+++ b/addons/web/static/src/js/views/list_view_editable.js
@@ -401,6 +401,17 @@ ListView.include(/** @lends instance.web.ListView# */{
return cells;
},
/**
+ * Prevent reloading content while an ongoing save
+ */
+ reload_content_when_ready: function() {
+ var self = this;
+ var self_super = this._super;
+ var original_arguments = arguments;
+ return this.saving_mutex.exec(function() {
+ return self_super.apply(self, original_arguments);
+ });
+ },
+ /**
* If currently editing a row, resizes all registered form fields based
* on the corresponding row cell
*/