[FIX] mail: open 'My Activities' from systray activity menu
Before this commit, when clicking on the activity view icon from an item in the systray activity menu, the activity view had no search filter by default. This commit now auto-select 'My Activities' in the activity view when redirected from the systray activity menu. closes odoo/odoo#30702
This commit is contained in:
@@ -118,7 +118,8 @@ var ActivityMenu = Widget.extend({
|
||||
name: targetAction.data('model_name'),
|
||||
views: [[false, 'activity'], [false, 'kanban'], [false, 'list']],
|
||||
view_mode: 'activity',
|
||||
res_model: targetAction.data('res_model')
|
||||
res_model: targetAction.data('res_model'),
|
||||
context: { search_default_activities_my: true },
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -151,7 +151,7 @@ QUnit.test('activity menu widget: activity menu with 3 records', function (asser
|
||||
});
|
||||
|
||||
QUnit.test('activity menu widget: activity view icon', function (assert) {
|
||||
assert.expect(8);
|
||||
assert.expect(10);
|
||||
var self = this;
|
||||
var activityMenu = new ActivityMenu();
|
||||
testUtils.mock.addMockEnvironment(activityMenu, {
|
||||
@@ -177,9 +177,15 @@ QUnit.test('activity menu widget: activity view icon', function (assert) {
|
||||
"Second activity action should link to 'Note'");
|
||||
assert.hasClass($second,'fa-clock-o', "should display the activity action icon");
|
||||
|
||||
testUtils.mock.intercept(activityMenu, 'do_action', function (event) {
|
||||
assert.step('do_action:' +
|
||||
(event.data.action.name ? event.data.action.name : event.data.action));
|
||||
testUtils.mock.intercept(activityMenu, 'do_action', function (ev) {
|
||||
if (ev.data.action.name) {
|
||||
assert.ok(ev.data.action.context, "should define a context on the action");
|
||||
assert.ok(ev.data.action.context.search_default_activities_my,
|
||||
"should auto-set search to 'My Activities' in the context of the action");
|
||||
assert.step('do_action:' + ev.data.action.name);
|
||||
} else {
|
||||
assert.step('do_action:' + ev.data.action);
|
||||
}
|
||||
}, true);
|
||||
|
||||
// click on the "Issue" activity icon
|
||||
|
||||
Reference in New Issue
Block a user