summaryrefslogtreecommitdiff
path: root/addons/stock/static/src
diff options
context:
space:
mode:
Diffstat (limited to 'addons/stock/static/src')
-rw-r--r--addons/stock/static/src/js/inventory_singleton_list_controller.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/stock/static/src/js/inventory_singleton_list_controller.js b/addons/stock/static/src/js/inventory_singleton_list_controller.js
index 30bd5c4b22a..b71f2d6ae39 100644
--- a/addons/stock/static/src/js/inventory_singleton_list_controller.js
+++ b/addons/stock/static/src/js/inventory_singleton_list_controller.js
@@ -19,6 +19,8 @@ var _t = core._t;
var SingletonListController = ListController.extend({
/**
* @override
+ * @return {Promise} rejected when update the list because we don't want
+ * anymore to select a cell who maybe doesn't exist anymore.
*/
_confirmSave: function (id) {
var newRecord = this.model.localData[id];
@@ -52,10 +54,11 @@ var SingletonListController = ListController.extend({
var notification = _t("You tried to create a record who already exists."+
"<br/>This last one has been modified instead.");
this.do_notify(_t("This record already exists."), notification);
- return this.reload();
+ this.reload();
+ return Promise.reject();
}
else {
- return this._super(id);
+ return this._super.apply(this, arguments);
}
},
});