From 55acc522b93341e456dafef69c9d2f7540a4407e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 18 Mar 2015 12:21:22 +0100 Subject: [PATCH] [FIX] web_calendar: don't focus quick create when disabled web_calendar tried to focus the quick create instance, even when it has been disabled. Result: boom (example: hr/leave request: click on calendar). --- addons/web_calendar/static/src/js/web_calendar.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/web_calendar/static/src/js/web_calendar.js b/addons/web_calendar/static/src/js/web_calendar.js index 466894c231c..a43cd0fcef7 100644 --- a/addons/web_calendar/static/src/js/web_calendar.js +++ b/addons/web_calendar/static/src/js/web_calendar.js @@ -357,7 +357,7 @@ var CalendarView = View.extend({ return this.quick.trigger('close'); } var QuickCreate = this.get_quick_create_class(); - + this.options.disable_quick_create = this.options.disable_quick_create || !this.quick_add_pop; this.quick = new QuickCreate(this, this.dataset, true, this.options, data_template); this.quick.on('added', this, this.quick_created) @@ -368,8 +368,9 @@ var CalendarView = View.extend({ this.$calendar.fullCalendar('unselect'); }); this.quick.replace(this.$el.find('.oe_calendar_qc_placeholder')); - this.quick.focus(); - + if (!this.options.disable_quick_create) { + this.quick.focus(); + } }, /**