From 077dde3a693d86fc23293ada862e2a7b7d60e083 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Tue, 26 Jul 2016 13:35:07 +0200 Subject: [PATCH] [FIX] calendar: don't duplicate all the calendar_contact Before this patch, add_filter was called 2 times. Once when we select a partner in the drop down, we trigger a onchange value to change from false to the partner id. Once to reset to false the value after the first add_filter() This commit closes #9758 --- addons/calendar/static/src/js/base_calendar.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/calendar/static/src/js/base_calendar.js b/addons/calendar/static/src/js/base_calendar.js index 411a5086f31..da9659bc788 100644 --- a/addons/calendar/static/src/js/base_calendar.js +++ b/addons/calendar/static/src/js/base_calendar.js @@ -101,8 +101,11 @@ function reload_favorite_list(result) { }, }); this.ir_model_m2o.insertAfter($('div.oe_calendar_filter')); - this.ir_model_m2o.on('change:value', self, function() { - self.add_filter(); + this.ir_model_m2o.on('change:value', self, function() { + // once selected, we reset the value to false. + if (self.ir_model_m2o.get_value()) { + self.add_filter(); + } }); }, add_filter: function() {