[FIX] web: fix the traceback on schedule activity view

Before this commit, when we open activity view and click on schedule
activity >> select a record there is a trackback due to the
invalid default_res_id passed in context.

So in this commit, fixes the issue by passing the valid res_id in
instead of object with id and display_name.

task-2927335

closes odoo/odoo#96999

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Sarika Shekhada
2022-08-24 21:06:55 +02:00
committed by Barad Mahendra
parent 6e9e7d32cc
commit 2be526b295
2 changed files with 2 additions and 2 deletions
@@ -68,7 +68,7 @@ var ActivityController = BasicController.extend({
disable_multiple_selection: true,
context: state.context,
on_selected: function (record) {
var fakeRecord = state.getKanbanActivityData({}, record[0]);
var fakeRecord = state.getKanbanActivityData({}, record[0].id);
var widget = new KanbanActivity(self, 'activity_ids', fakeRecord, {});
widget.scheduleActivity();
},
@@ -367,7 +367,7 @@ QUnit.test('activity view: search more to schedule an activity for a record of a
assert.step('doAction');
var expectedAction = {
context: {
default_res_id: { id: mailTestActivityId1, display_name: undefined },
default_res_id: mailTestActivityId1,
default_res_model: "mail.test.activity",
},
name: "Schedule Activity",