summaryrefslogtreecommitdiff
path: root/addons/crm/static/src/js/systray_activity_menu.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/crm/static/src/js/systray_activity_menu.js')
-rw-r--r--addons/crm/static/src/js/systray_activity_menu.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/addons/crm/static/src/js/systray_activity_menu.js b/addons/crm/static/src/js/systray_activity_menu.js
index ad53b6734da..021375de91c 100644
--- a/addons/crm/static/src/js/systray_activity_menu.js
+++ b/addons/crm/static/src/js/systray_activity_menu.js
@@ -22,5 +22,35 @@ ActivityMenu.include({
}
return this._super(...arguments);
},
+
+ //-----------------------------------------
+ // Handlers
+ //-----------------------------------------
+
+ /**
+ * @private
+ * @override
+ */
+ _onActivityFilterClick: function (event) {
+ // fetch the data from the button otherwise fetch the ones from the parent (.o_mail_preview).
+ var data = _.extend({}, $(event.currentTarget).data(), $(event.target).data());
+ var context = {};
+ if (data.res_model === "crm.lead") {
+ if (data.filter === 'my') {
+ context['search_default_activities_overdue'] = 1;
+ context['search_default_activities_today'] = 1;
+ } else {
+ context['search_default_activities_' + data.filter] = 1;
+ }
+ // Necessary because activity_ids of mail.activity.mixin has auto_join
+ // So, duplicates are faking the count and "Load more" doesn't show up
+ context['force_search_count'] = 1;
+ this.do_action('crm.crm_lead_action_my_activities', {
+ additional_context: context
+ });
+ } else {
+ this._super.apply(this, arguments);
+ }
+ },
});
});