29_12_25
This commit is contained in:
43
src/App.jsx
43
src/App.jsx
@@ -42,12 +42,11 @@ function SplashScreen() {
|
|||||||
Communication Tryton
|
Communication Tryton
|
||||||
-------------------------- */
|
-------------------------- */
|
||||||
|
|
||||||
function openInTryton(model, res_id, view_mode = "tree", domain) {
|
function openInTryton(model, res_id, view_mode = ['tree'], domain) {
|
||||||
window.parent.postMessage(
|
window.parent.postMessage(
|
||||||
{
|
{
|
||||||
type: "open_tab",
|
type: "open_tab",
|
||||||
// payload: { model, res_id, view_mode, domain },
|
payload: { model, res_id, view_mode, domain },
|
||||||
payload: { model, domain },
|
|
||||||
},
|
},
|
||||||
"*"
|
"*"
|
||||||
);
|
);
|
||||||
@@ -88,27 +87,27 @@ const data = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const purchaseData = [
|
const purchaseData = [
|
||||||
{ status: "Draft", count: draft_p, color: "bg-teal-500", onClick: () => openInTryton("purchase.purchase", undefined, "tree",[['state', '=', 'draft']])},
|
{ 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") },
|
{ 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") },
|
{ status: "Confirmed", count: conf_p, color: "bg-blue-500", onClick: () => openInTryton("purchase.purchase", undefined, ['tree', 'form'],[['state', '=', 'confirmed']]) },
|
||||||
];
|
];
|
||||||
|
|
||||||
const saleData = [
|
const saleData = [
|
||||||
{ status: "Draft", count: draft_s, color: "bg-teal-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") },
|
{ 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") },
|
{ status: "Confirmed", count: conf_s, color: "bg-blue-500", onClick: () => openInTryton("sale.sale", undefined, ['tree', 'form'],[['state', '=', 'confirmed']]) },
|
||||||
];
|
];
|
||||||
|
|
||||||
const shipmentData = [
|
const shipmentData = [
|
||||||
{ status: "Draft", count: shipment_d, color: "bg-teal-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") },
|
{ 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") },
|
{ status: "Received", count: shipment_r, color: "bg-blue-500", onClick: () => openInTryton("stock.shipment.in", undefined, ['tree', 'form'],[['state', '=', 'received']]) },
|
||||||
];
|
];
|
||||||
|
|
||||||
const lotData = [
|
const lotData = [
|
||||||
{ status: "Matched", count: lot_m, color: "bg-teal-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") },
|
{ 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") },
|
{ status: "All", count: lot_al, color: "bg-blue-500", onClick: () => openInTryton("lot.report", undefined, ['tree', 'form'],[['id', '>', 0]]) },
|
||||||
];
|
];
|
||||||
|
|
||||||
const kpis = [
|
const kpis = [
|
||||||
@@ -118,7 +117,7 @@ const kpis = [
|
|||||||
trend: "+12% vs last month",
|
trend: "+12% vs last month",
|
||||||
trendValue: 12,
|
trendValue: 12,
|
||||||
icon: BarChart3,
|
icon: BarChart3,
|
||||||
action: () => openInTryton("pnl.bi", [1], "form")
|
action: () => openInTryton("pnl.bi", [1], ['form'])
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Exposure (Mt)",
|
title: "Exposure (Mt)",
|
||||||
@@ -126,7 +125,7 @@ const kpis = [
|
|||||||
trend: "-3% this month",
|
trend: "-3% this month",
|
||||||
trendValue: -3,
|
trendValue: -3,
|
||||||
icon: Gauge,
|
icon: Gauge,
|
||||||
action: () => openInTryton("open.position.report", undefined, "tree")
|
action: () => openInTryton("open.position.report", undefined, ['tree'])
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Amount to pay ($)",
|
title: "Amount to pay ($)",
|
||||||
@@ -134,7 +133,7 @@ const kpis = [
|
|||||||
trend: "+5% this month",
|
trend: "+5% this month",
|
||||||
trendValue: 5,
|
trendValue: 5,
|
||||||
icon: DollarSign,
|
icon: DollarSign,
|
||||||
action: () => openInTryton("account.invoice", undefined, "tree")
|
action: () => openInTryton("account.invoice", undefined, ['tree'])
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Amount to receive ($)",
|
title: "Amount to receive ($)",
|
||||||
@@ -142,7 +141,7 @@ const kpis = [
|
|||||||
trend: "-1% this month",
|
trend: "-1% this month",
|
||||||
trendValue: -1,
|
trendValue: -1,
|
||||||
icon: HandCoins,
|
icon: HandCoins,
|
||||||
action: () => openInTryton("account.invoice", undefined, "tree")
|
action: () => openInTryton("account.invoice", undefined, ['tree'])
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -179,7 +178,7 @@ const cards = [
|
|||||||
value: inv_p,
|
value: inv_p,
|
||||||
trend: "-2% this week",
|
trend: "-2% this week",
|
||||||
icon: Receipt,
|
icon: Receipt,
|
||||||
action: () => openInTryton("account.invoice", undefined, "tree")
|
action: () => openInTryton("account.invoice", undefined, ['tree'])
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "sale_invoices",
|
id: "sale_invoices",
|
||||||
@@ -187,7 +186,7 @@ const cards = [
|
|||||||
value: inv_s,
|
value: inv_s,
|
||||||
trend: "+2% this week",
|
trend: "+2% this week",
|
||||||
icon: FileText,
|
icon: FileText,
|
||||||
action: () => openInTryton("account.invoice", undefined, "tree")
|
action: () => openInTryton("account.invoice", undefined, ['tree'])
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "payments_to_validate",
|
id: "payments_to_validate",
|
||||||
@@ -195,7 +194,7 @@ const cards = [
|
|||||||
value: move_cash,
|
value: move_cash,
|
||||||
trend: "+12% this week",
|
trend: "+12% this week",
|
||||||
icon: HandCoins,
|
icon: HandCoins,
|
||||||
action: () => openInTryton("account.move", undefined, "tree")
|
action: () => openInTryton("account.move", undefined, ['tree'])
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// id: "prepayments",
|
// id: "prepayments",
|
||||||
|
|||||||
Reference in New Issue
Block a user