From fff449a419ac1ce5a8c170ecc159bbfa3fb339b6 Mon Sep 17 00:00:00 2001 From: bit-odoo Date: Thu, 9 Feb 2023 08:55:31 +0000 Subject: [PATCH] [IMP] calendar: calendar app should open on due date with pop-up opened PURPOSE Calendar app should open with pop-up opened SPECIFICATIONS When activity of type meeting is edited(Reschedule), he gets a calendar app open on due date's week.The calendar app should be opened with the corresponding meeting highlighted (or the pop-up opened same as if the user has click on it) Task-2528115 closes odoo/odoo#72544 Signed-off-by: Arnaud Joset (arj) --- addons/calendar/models/mail_activity.py | 2 ++ .../common/attendee_calendar_common_renderer.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/addons/calendar/models/mail_activity.py b/addons/calendar/models/mail_activity.py index d3dff3f9f67..da30c6629d4 100644 --- a/addons/calendar/models/mail_activity.py +++ b/addons/calendar/models/mail_activity.py @@ -22,6 +22,8 @@ class MailActivity(models.Model): 'default_activity_ids': [(6, 0, self.ids)], 'default_partner_ids': self.user_id.partner_id.ids, 'default_user_id': self.user_id.id, + 'initial_date': self.date_deadline, + 'default_calendar_event_id': self.calendar_event_id.id, } return action diff --git a/addons/calendar/static/src/views/attendee_calendar/common/attendee_calendar_common_renderer.js b/addons/calendar/static/src/views/attendee_calendar/common/attendee_calendar_common_renderer.js index 5fe511fb28d..4e667fe4464 100644 --- a/addons/calendar/static/src/views/attendee_calendar/common/attendee_calendar_common_renderer.js +++ b/addons/calendar/static/src/views/attendee_calendar/common/attendee_calendar_common_renderer.js @@ -36,6 +36,9 @@ export class AttendeeCalendarCommonRenderer extends CalendarCommonRenderer { const record = this.props.model.records[event.id]; if (record) { + if (this.env.searchModel?.context?.default_calendar_event_id === parseInt(event.id)) { + this.openPopover(info.el, record); + } if (record.rawRecord.is_highlighted) { el.classList.add("o_event_highlight"); }