From 4cfd03d0565defc4bd37ab032c1b61ef4fccf38a Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 30 Mar 2017 17:35:35 +0200 Subject: [PATCH] [FIX] calendar: no add Contact when no useContacts On a form view the attribute `use_contacts` will: - when set to True: enable us to add contacts which will be available on any time in the calendar, - when unset: the list of contact is only the contact currently beeing seen directly in the calendar. The feature for adding contact is thus not necessary when `use_contacts` is unset. But it still appeared without having any effect (which is unexpected). This commit remove the contact adding feature when it has no necessity. opw-715932 --- addons/calendar/static/src/js/base_calendar.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/calendar/static/src/js/base_calendar.js b/addons/calendar/static/src/js/base_calendar.js index e6dad933f81..3533ef9b5a4 100644 --- a/addons/calendar/static/src/js/base_calendar.js +++ b/addons/calendar/static/src/js/base_calendar.js @@ -116,6 +116,9 @@ widgets.SidebarFilter.include({ }, initialize_m2o: function() { var self = this; + if (!this.view.useContacts) { + return; + } this.dfm = new form_common.DefaultFieldManager(self); this.dfm.extend_field_desc({ partner_id: {