From 5fa51c5201c0e2244531b192f26e9b55751d4aa8 Mon Sep 17 00:00:00 2001 From: Adrien Dieudonne Date: Wed, 21 Jun 2017 10:46:09 +0200 Subject: [FIX] web: basic_controller: avoid multiple name_create Before this fix, multiple records were created if you clicked on the quick create of a many2one in a modal. The 'mutexify' event wasn't stopped and was thus handled by the dialog's form controller and by the main form controller. --- addons/web/static/src/js/views/basic/basic_controller.js | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/web/static/src/js/views/basic/basic_controller.js') diff --git a/addons/web/static/src/js/views/basic/basic_controller.js b/addons/web/static/src/js/views/basic/basic_controller.js index af4ca7d7a08..2ade7f7ca8c 100644 --- a/addons/web/static/src/js/views/basic/basic_controller.js +++ b/addons/web/static/src/js/views/basic/basic_controller.js @@ -534,6 +534,7 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { * @param {function} ev.data.action the function to execute in the mutex */ _onMutexify: function (ev) { + ev.stopPropagation(); // prevent other controllers from handling this request this.mutex.exec(ev.data.action); }, /** -- cgit v1.2.3 From 3de0715f12d1a965d444f2d1cc816ca3d740a839 Mon Sep 17 00:00:00 2001 From: Martin Geubelle Date: Wed, 21 Jun 2017 16:42:56 +0200 Subject: [FIX] web: basicController: stop translate event Before this fix, a traceback occured when we clicked on the translate icon in a form dialog. The `translate` event wasn't stopped and was thus handled by the dialog's form controller and by the main controller. --- addons/web/static/src/js/views/basic/basic_controller.js | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/web/static/src/js/views/basic/basic_controller.js') diff --git a/addons/web/static/src/js/views/basic/basic_controller.js b/addons/web/static/src/js/views/basic/basic_controller.js index 2ade7f7ca8c..5024a67677e 100644 --- a/addons/web/static/src/js/views/basic/basic_controller.js +++ b/addons/web/static/src/js/views/basic/basic_controller.js @@ -579,6 +579,7 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { * @param {OdooEvent} event */ _onTranslate: function (event) { + event.stopPropagation(); var record = this.model.get(event.data.id, {raw: true}); this._rpc({ route: '/web/dataset/call_button', -- cgit v1.2.3 From 0236ac510bbb58f5630a4249103ecf509160dbc7 Mon Sep 17 00:00:00 2001 From: David Monjoie Date: Wed, 21 Jun 2017 14:10:20 +0200 Subject: [FIX] web: update buttons in editable list view when no changes When I introduced this line in 374295b, I was working on the form view and didn't realize I would be breaking the editable list view. The _setMode function only updates the buttons when given the id of a record. Since I was working on a form view at the time, I didn't need to give a recordID to make it work since the default ID of a form view is the id of the record itself. However, in editable list view, the id of the view is a list of ids, so the buttons would not be updated in this case. --- addons/web/static/src/js/views/basic/basic_controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/basic/basic_controller.js') diff --git a/addons/web/static/src/js/views/basic/basic_controller.js b/addons/web/static/src/js/views/basic/basic_controller.js index 5024a67677e..67a4fa504d8 100644 --- a/addons/web/static/src/js/views/basic/basic_controller.js +++ b/addons/web/static/src/js/views/basic/basic_controller.js @@ -423,7 +423,7 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { }); if (!options.stayInEdit) { saveDef = saveDef.then(function (fieldNames) { - var def = fieldNames.length ? self._confirmSave(recordID) : self._setMode('readonly'); + var def = fieldNames.length ? self._confirmSave(recordID) : self._setMode('readonly', recordID); return def.then(function () { return fieldNames; }); -- cgit v1.2.3