Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix: redirect after part insert

Brad Barbinf66d32d066a2
diff --git a/apps/erp/app/modules/items/items.service.ts b/apps/erp/app/modules/items/items.service.ts
index b01f7ed6af..d5869405df 100644
--- a/apps/erp/app/modules/items/items.service.ts
+++ b/apps/erp/app/modules/items/items.service.ts
@@ -1782,6 +1782,7 @@ export async function upsertConsumable(
.from("consumables")
.select("id")
.eq("readableId", consumable.id)
+ .eq("companyId", consumable.companyId)
.single();
return newConsumable;
@@ -1887,6 +1888,7 @@ export async function upsertPart(
.from("parts")
.select("id")
.eq("readableId", part.id)
+ .eq("companyId", part.companyId)
.single();
return newPart;
@@ -2399,6 +2401,7 @@ export async function upsertMaterial(
.from("materials")
.select("*")
.eq("readableId", material.id)
+ .eq("companyId", material.companyId)
.single();
return newMaterial;
@@ -2699,6 +2702,7 @@ export async function upsertTool(
.from("tools")
.select("*")
.eq("readableId", tool.id)
+ .eq("companyId", tool.companyId)
.single();
return newTool;