Skip to content

Commit 54337dd

Browse files
committed
fix(spp_programs): pass translated name and view_id to client action
1 parent cec6a18 commit 54337dd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

spp_programs/static/src/js/create_program.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import {useService} from "@web/core/utils/hooks";
1515
async function openProgramCloseModal(env, action) {
1616
const actionService = env.services.action;
1717
const programId = action.params?.program_id;
18+
const programName = action.params?.name || "Program";
19+
const viewId = action.params?.view_id || false;
1820

1921
await actionService.doAction(
2022
{type: "ir.actions.act_window_close"},
@@ -24,10 +26,10 @@ async function openProgramCloseModal(env, action) {
2426
if (programId) {
2527
await actionService.doAction({
2628
type: "ir.actions.act_window",
27-
name: "Program",
29+
name: programName,
2830
res_model: "spp.program",
2931
res_id: programId,
30-
views: [[false, "form"]],
32+
views: [[viewId, "form"]],
3133
target: "current",
3234
});
3335
}

spp_programs/wizard/create_program_wizard.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@ def create_program(self):
429429
"tag": "open_program_close_modal",
430430
"params": {
431431
"program_id": program_id,
432+
"name": _("Program"),
433+
"view_id": view_id.id,
432434
},
433435
}
434436

0 commit comments

Comments
 (0)