diff --git a/tryton-sao.js b/tryton-sao.js index 8247b0c..c2e6dcf 100644 --- a/tryton-sao.js +++ b/tryton-sao.js @@ -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) { - // ⚠️ Sécurité : vérifier l'origine - // if (event.origin !== "https://ton-react.example.com") return; - 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", + const { model, domain } = event.data.payload || {}; + + Sao.Action.exec({ + name: "Dashboard", + type: "ir.action.act_window", + res_model: model, + domain: domain || [], + views: [ + [null, "tree"], + [null, "form"] + ], + target: "current", + context: {} }); } });