diff options
| author | Julien Castiaux <juc@odoo.com> | 2019-07-15 15:56:14 +0000 |
|---|---|---|
| committer | Julien Castiaux <juc@odoo.com> | 2019-08-02 11:42:27 +0000 |
| commit | e26a5e46ffc5645885f4a704efd083df8a6a168f (patch) | |
| tree | 8cffb2bb44d9867c81f9496c687d9dea9f3f7c17 /addons/web/static/src | |
| parent | 6ee3950bcfbdd011733c2df656073ea5510d0cc4 (diff) | |
[FIX] web: spam new event creates multiple modals
On the Time Off, spam click to create a new event, each click opens a
new event form modal.
When the modal form fields have not been cached yet, the frontend
fetches them and delay the modal form opening after those fields have
been fetched. As the interface is still available. It is possible to
re-click multiple time during the fetch, each click schedules a new
modal form. When the first finally shows, they all stack on screen.
opw-203577
closes odoo/odoo#35098
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/calendar/calendar_controller.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/web/static/src/js/views/calendar/calendar_controller.js b/addons/web/static/src/js/views/calendar/calendar_controller.js index a6dec31afe1..0c681209825 100644 --- a/addons/web/static/src/js/views/calendar/calendar_controller.js +++ b/addons/web/static/src/js/views/calendar/calendar_controller.js @@ -55,6 +55,7 @@ var CalendarController = AbstractController.extend({ this.readonlyFormViewId = params.readonlyFormViewId; this.mapping = params.mapping; this.context = params.context; + this.previousOpen = null; // The quickCreating attribute ensures that we don't do several create this.quickCreating = false; }, @@ -271,7 +272,8 @@ var CalendarController = AbstractController.extend({ title += ': ' + this.renderer.arch.attrs.string; } if (this.eventOpenPopup) { - new dialogs.FormViewDialog(self, { + if (this.previousOpen) { this.previousOpen.close(); } + this.previousOpen = new dialogs.FormViewDialog(self, { res_model: this.modelName, context: context, title: title, @@ -283,7 +285,8 @@ var CalendarController = AbstractController.extend({ } self.reload(); }, - }).open(); + }); + this.previousOpen.open(); } else { this.do_action({ type: 'ir.actions.act_window', |
