[FIX] calendar: notification detail correct redirection

Step to reproduce:
- Create an event in calendar with reminder
- (Move the event to trigger the reminder)
- Click on 'Details'

Current Behaviour:
- Open a new event

Behaviour after PR:
- Open the event linked to the notification

opw-2761492

closes odoo/odoo#85089

X-original-commit: e1787f5a107f452f5c50e4e931cdd7afcea04e48
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
This commit is contained in:
Florian Damhaut
2022-03-07 08:47:40 +00:00
parent e663077c11
commit c1014d9cd6
4 changed files with 12 additions and 16 deletions
@@ -13,7 +13,10 @@
const self = this;
// When clicking on "Add", create a new record in form view
this.$buttons.on('click', 'button.o-calendar-button-new', () => {
return self.do_action('calendar.action_calendar_event_notify', {
return self.do_action({
type: 'ir.actions.act_window',
res_model: 'calendar.event',
views: [[false, 'form']],
additional_context: self.context,
});
});
@@ -63,11 +63,12 @@ export const calendarNotificationService = {
{
name: env._t("Details"),
onClick: async () => {
await action.doAction(
"calendar.action_calendar_event_notify",
{
resId: notif.event_id,
}
await action.doAction({
type: 'ir.actions.act_window',
res_model: 'calendar.event',
res_id: notif.event_id,
views: [[false, 'form']],
}
);
notificationRemove();
},
@@ -131,7 +131,7 @@ QUnit.module("Calendar Notification", (hooks) => {
start() {
return {
doAction(actionId) {
assert.step(actionId);
assert.step(actionId.type);
return Promise.resolve(true);
},
loadState(state, options) {
@@ -157,7 +157,7 @@ QUnit.module("Calendar Notification", (hooks) => {
);
await click(target.querySelectorAll(".o_notification_buttons .btn")[1]);
assert.verifySteps(["calendar.action_calendar_event_notify"]);
assert.verifySteps(["ir.actions.act_window"]);
assert.containsNone(target, ".o_notification");
}
);
-8
View File
@@ -423,12 +423,4 @@
action="action_calendar_alarm"
groups="base.group_no_one"/>
<!-- called in js from '/js/base_calendar.js' -->
<record id="action_calendar_event_notify" model="ir.actions.act_window">
<field name="name">Meetings</field>
<field name="res_model">calendar.event</field>
<field name="view_mode">form,calendar,tree</field>
<field name="view_id" ref="view_calendar_event_form"/>
</record>
</odoo>