[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
This commit is contained in:
Jeremy Kersten 2016-07-26 13:35:07 +02:00
parent e1c55b2d2d
commit 077dde3a69
1 changed files with 5 additions and 2 deletions

View File

@ -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() {