From 9258a76029103f53662df240f3a7348e904fa4f8 Mon Sep 17 00:00:00 2001 From: laurentbarontini Date: Mon, 29 Dec 2025 16:09:13 +0100 Subject: [PATCH] 29_12_25 --- src/App.jsx | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 3a6c83f7..0cc821ad 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -42,12 +42,11 @@ function SplashScreen() { Communication Tryton -------------------------- */ -function openInTryton(model, res_id, view_mode = "tree", domain) { +function openInTryton(model, res_id, view_mode = ['tree'], domain) { window.parent.postMessage( { type: "open_tab", - // payload: { model, res_id, view_mode, domain }, - payload: { model, domain }, + payload: { model, res_id, view_mode, domain }, }, "*" ); @@ -88,27 +87,27 @@ const data = [ ]; const purchaseData = [ - { status: "Draft", count: draft_p, color: "bg-teal-500", onClick: () => openInTryton("purchase.purchase", undefined, "tree",[['state', '=', 'draft']])}, - { status: "Validated", count: val_p, color: "bg-cyan-500", onClick: () => openInTryton("purchase.purchase", undefined, "tree") }, - { status: "Confirmed", count: conf_p, color: "bg-blue-500", onClick: () => openInTryton("purchase.purchase", undefined, "tree") }, + { status: "Draft", count: draft_p, color: "bg-teal-500", onClick: () => openInTryton("purchase.purchase", undefined, ['tree', 'form'],[['state', '=', 'draft']])}, + { status: "Validated", count: val_p, color: "bg-cyan-500", onClick: () => openInTryton("purchase.purchase", undefined, ['tree', 'form'],[['state', '=', 'quotation']]) }, + { status: "Confirmed", count: conf_p, color: "bg-blue-500", onClick: () => openInTryton("purchase.purchase", undefined, ['tree', 'form'],[['state', '=', 'confirmed']]) }, ]; const saleData = [ - { status: "Draft", count: draft_s, color: "bg-teal-500", onClick: () => openInTryton("sale.sale", undefined, "tree")}, - { status: "Validated", count: val_s, color: "bg-cyan-500", onClick: () => openInTryton("sale.sale", undefined, "tree") }, - { status: "Confirmed", count: conf_s, color: "bg-blue-500", onClick: () => openInTryton("sale.sale", undefined, "tree") }, + { status: "Draft", count: draft_s, color: "bg-teal-500", onClick: () => openInTryton("sale.sale", undefined, ['tree', 'form'],[['state', '=', 'draft']])}, + { status: "Validated", count: val_s, color: "bg-cyan-500", onClick: () => openInTryton("sale.sale", undefined, ['tree', 'form'],[['state', '=', 'quotation']]) }, + { status: "Confirmed", count: conf_s, color: "bg-blue-500", onClick: () => openInTryton("sale.sale", undefined, ['tree', 'form'],[['state', '=', 'confirmed']]) }, ]; const shipmentData = [ - { status: "Draft", count: shipment_d, color: "bg-teal-500", onClick: () => openInTryton("stock.shipment.in", undefined, "tree")}, - { status: "Started", count: shipment_s, color: "bg-cyan-500", onClick: () => openInTryton("stock.shipment.in", undefined, "tree") }, - { status: "Received", count: shipment_r, color: "bg-blue-500", onClick: () => openInTryton("stock.shipment.in", undefined, "tree") }, + { status: "Draft", count: shipment_d, color: "bg-teal-500", onClick: () => openInTryton("stock.shipment.in", undefined, ['tree', 'form'],[['state', '=', 'draft']])}, + { status: "Started", count: shipment_s, color: "bg-cyan-500", onClick: () => openInTryton("stock.shipment.in", undefined, ['tree', 'form'],[['state', '=', 'started']]) }, + { status: "Received", count: shipment_r, color: "bg-blue-500", onClick: () => openInTryton("stock.shipment.in", undefined, ['tree', 'form'],[['state', '=', 'received']]) }, ]; const lotData = [ - { status: "Matched", count: lot_m, color: "bg-teal-500", onClick: () => openInTryton("lot.report", undefined, "tree")}, - { status: "Available", count: lot_a, color: "bg-cyan-500", onClick: () => openInTryton("lot.report", undefined, "tree") }, - { status: "All", count: lot_al, color: "bg-blue-500", onClick: () => openInTryton("lot.report", undefined, "tree") }, + { status: "Matched", count: lot_m, color: "bg-teal-500", onClick: () => openInTryton("lot.report", undefined, ['tree', 'form'],[['id', '>', 0]])}, + { status: "Available", count: lot_a, color: "bg-cyan-500", onClick: () => openInTryton("lot.report", undefined, ['tree', 'form'],[['id', '>', 0]]) }, + { status: "All", count: lot_al, color: "bg-blue-500", onClick: () => openInTryton("lot.report", undefined, ['tree', 'form'],[['id', '>', 0]]) }, ]; const kpis = [ @@ -118,7 +117,7 @@ const kpis = [ trend: "+12% vs last month", trendValue: 12, icon: BarChart3, - action: () => openInTryton("pnl.bi", [1], "form") + action: () => openInTryton("pnl.bi", [1], ['form']) }, { title: "Exposure (Mt)", @@ -126,7 +125,7 @@ const kpis = [ trend: "-3% this month", trendValue: -3, icon: Gauge, - action: () => openInTryton("open.position.report", undefined, "tree") + action: () => openInTryton("open.position.report", undefined, ['tree']) }, { title: "Amount to pay ($)", @@ -134,7 +133,7 @@ const kpis = [ trend: "+5% this month", trendValue: 5, icon: DollarSign, - action: () => openInTryton("account.invoice", undefined, "tree") + action: () => openInTryton("account.invoice", undefined, ['tree']) }, { title: "Amount to receive ($)", @@ -142,7 +141,7 @@ const kpis = [ trend: "-1% this month", trendValue: -1, icon: HandCoins, - action: () => openInTryton("account.invoice", undefined, "tree") + action: () => openInTryton("account.invoice", undefined, ['tree']) }, ]; @@ -179,7 +178,7 @@ const cards = [ value: inv_p, trend: "-2% this week", icon: Receipt, - action: () => openInTryton("account.invoice", undefined, "tree") + action: () => openInTryton("account.invoice", undefined, ['tree']) }, { id: "sale_invoices", @@ -187,7 +186,7 @@ const cards = [ value: inv_s, trend: "+2% this week", icon: FileText, - action: () => openInTryton("account.invoice", undefined, "tree") + action: () => openInTryton("account.invoice", undefined, ['tree']) }, { id: "payments_to_validate", @@ -195,7 +194,7 @@ const cards = [ value: move_cash, trend: "+12% this week", icon: HandCoins, - action: () => openInTryton("account.move", undefined, "tree") + action: () => openInTryton("account.move", undefined, ['tree']) }, // { // id: "prepayments",