28_12_25
This commit is contained in:
@@ -20672,19 +20672,36 @@ function eval_pyson(value){
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// window.addEventListener("message", function (event) {
|
||||||
|
// if (event.data?.type === "open_tab") {
|
||||||
|
// const { model, res_id, view_mode, domain } = event.data.payload || {};
|
||||||
|
|
||||||
|
// Sao.Tab.create({
|
||||||
|
// model: model,
|
||||||
|
// res_id: res_id,
|
||||||
|
// mode: [view_mode],
|
||||||
|
// domain: domain,
|
||||||
|
// target: "new",
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
window.addEventListener("message", function (event) {
|
window.addEventListener("message", function (event) {
|
||||||
// ⚠️ Sécurité : vérifier l'origine
|
|
||||||
// if (event.origin !== "https://ton-react.example.com") return;
|
|
||||||
|
|
||||||
if (event.data?.type === "open_tab") {
|
if (event.data?.type === "open_tab") {
|
||||||
const { model, res_id, view_mode, domain } = event.data.payload || {};
|
|
||||||
|
|
||||||
Sao.Tab.create({
|
const { model, domain } = event.data.payload || {};
|
||||||
model: model,
|
|
||||||
res_id: res_id,
|
Sao.Action.exec({
|
||||||
mode: [view_mode],
|
name: "Dashboard",
|
||||||
domain: domain,
|
type: "ir.action.act_window",
|
||||||
target: "new",
|
res_model: model,
|
||||||
|
domain: domain || [],
|
||||||
|
views: [
|
||||||
|
[null, "tree"],
|
||||||
|
[null, "form"]
|
||||||
|
],
|
||||||
|
target: "current",
|
||||||
|
context: {}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user