Skip to content

Commit dd8d38d

Browse files
committed
fix(spp_programs): pass translated name and view_id to client action
1 parent 5354362 commit dd8d38d

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
@@ -14,6 +14,8 @@ import {useService} from "@web/core/utils/hooks";
1414
async function openProgramCloseModal(env, action) {
1515
const actionService = env.services.action;
1616
const programId = action.params?.program_id;
17+
const programName = action.params?.name || "Program";
18+
const viewId = action.params?.view_id || false;
1719

1820
// First close the modal
1921
await actionService.doAction(
@@ -25,10 +27,10 @@ async function openProgramCloseModal(env, action) {
2527
if (programId) {
2628
await actionService.doAction({
2729
type: "ir.actions.act_window",
28-
name: "Program",
30+
name: programName,
2931
res_model: "spp.program",
3032
res_id: programId,
31-
views: [[false, "form"]],
33+
views: [[viewId, "form"]],
3234
target: "current",
3335
});
3436
}

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)