Skip to content

Commit 07c5ccc

Browse files
committed
[FIX] report_substitute: ensure substitution_handler returns the correct report handler
When the report type differs between the original report and the substitution, the substitution_handler must return the handler corresponding to the substitution report type Failing to do so may cause issues, as the report action would be executed using a handler from a different report type, leading to unexpected behavior or errors
1 parent 5d01b3c commit 07c5ccc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

report_substitute/static/src/js/action_manager.esm.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ registry
2121
"get_substitution_report_action",
2222
[action, active_ids]
2323
);
24-
Object.assign(action, substitution);
24+
const handlers = registry.category("ir.actions.report handlers").getAll();
25+
for (const handler of handlers) {
26+
const result = await handler(substitution, options, env);
27+
if (result) {
28+
return result;
29+
}
30+
}
2531
}
2632
return Promise.resolve(false);
2733
});

0 commit comments

Comments
 (0)