diff --git a/tryton-sao.js b/tryton-sao.js index 89d3ff5..a5b7f87 100644 --- a/tryton-sao.js +++ b/tryton-sao.js @@ -20684,6 +20684,45 @@ function eval_pyson(value){ target: "new", }); } + if (event.data?.type === "exec_window"){ + const { model, res_id, view_mode, domain } = event.data.payload || {}; + var action = { + id: 'act_allocation_matched_form', + type: 'ir.action.act_window', + name: 'Lots matched', + res_model: 'lot.report', + + // PYSON sous forme de string + pyson_domain: "[('r_lot_matched', '>', 0)]", + + pyson_context: JSON.stringify({ + purchase: null, + sale: null, + shipment: null, + type: 'matched', + state: 'all', + wh: 'all', + group: 'by_physic' + }), + + views: [], // ou préciser des vues si besoin + domains: [] // onglets de domaine (optionnel) + }; + + // Données actives (souvent vides pour une action menu) + var data = { + model: null, + id: null, + ids: [] + }; + + // Contexte supplémentaire (optionnel) + var context = {}; + + // Exécution + Sao.Action.exec_action(action, data, context); + + } }); Sao.renderHTMLViewerContent = function(container, value, height, width, record) {