diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/calendar/static/src/js/systray_activity_menu.js | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/calendar/static/src/js/systray_activity_menu.js')
| -rw-r--r-- | addons/calendar/static/src/js/systray_activity_menu.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/addons/calendar/static/src/js/systray_activity_menu.js b/addons/calendar/static/src/js/systray_activity_menu.js new file mode 100644 index 00000000..d6f98b69 --- /dev/null +++ b/addons/calendar/static/src/js/systray_activity_menu.js @@ -0,0 +1,56 @@ +odoo.define('calendar.systray.ActivityMenu', function (require) { +"use strict"; + +var ActivityMenu = require('mail.systray.ActivityMenu'); +var fieldUtils = require('web.field_utils'); + +ActivityMenu.include({ + + //----------------------------------------- + // Private + //----------------------------------------- + + /** + * parse date to server value + * + * @private + * @override + */ + _getActivityData: function () { + var self = this; + return this._super.apply(this, arguments).then(function () { + var meeting = _.find(self._activities, {type: 'meeting'}); + if (meeting && meeting.meetings) { + _.each(meeting.meetings, function (res) { + res.start = fieldUtils.parse.datetime(res.start, false, {isUTC: true}); + }); + } + }); + }, + + //----------------------------------------- + // Handlers + //----------------------------------------- + + /** + * @private + * @override + */ + _onActivityFilterClick: function (ev) { + var $el = $(ev.currentTarget); + var data = _.extend({}, $el.data()); + if (data.res_model === "calendar.event" && data.filter === "my") { + this.do_action('calendar.action_calendar_event', { + additional_context: { + default_mode: 'day', + search_default_mymeetings: 1, + }, + clear_breadcrumbs: true, + }); + } else { + this._super.apply(this, arguments); + } + }, +}); + +}); |
