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.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
fix(mes): only show serial picker on serial parts, not batch/non-tracked (#1330)
Brad Barbin3974b121a1f6
diff --git a/apps/mes/app/components/JobOperation/JobOperation.tsx b/apps/mes/app/components/JobOperation/JobOperation.tsxindex 243543e4c3..66d3a53d26 100644--- a/apps/mes/app/components/JobOperation/JobOperation.tsx+++ b/apps/mes/app/components/JobOperation/JobOperation.tsx@@ -299,6 +299,7 @@ export const JobOperation = ({events,trackedEntities,isFirstOperation,+ requiresSerialTracking: !!parentIsSerial,pauseInterval: isModalOpen,procedure,// First operation only (no labels to scan yet): auto-select the next unit.diff --git a/apps/mes/app/components/JobOperation/hooks/useOperation.tsx b/apps/mes/app/components/JobOperation/hooks/useOperation.tsxindex 2d5ddb7abf..13d0fd3c0b 100644--- a/apps/mes/app/components/JobOperation/hooks/useOperation.tsx+++ b/apps/mes/app/components/JobOperation/hooks/useOperation.tsx@@ -31,6 +31,7 @@ export function useOperation({events,trackedEntities,isFirstOperation,+ requiresSerialTracking,pauseInterval,procedure,onAdvanceToUnit@@ -41,6 +42,10 @@ export function useOperation({// The first operation in the routing has no printed labels yet, so units are// auto-selected; later operations require the operator to scan/select.isFirstOperation: boolean;+ // The scan/select serial flow only applies to serial-tracked parts. Batch and+ // non-tracked make-methods must never see the serial picker, even though a+ // batch make-method carries a seed trackedEntity row.+ requiresSerialTracking: boolean;pauseInterval: boolean;procedure: Promise<{attributes: JobOperationStep[];@@ -285,6 +290,9 @@ export function useOperation({// in the URL) and again after each completion.// biome-ignore lint/correctness/useExhaustiveDependencies: suppressed due to migrationuseEffect(() => {+ // Only serial-tracked parts have per-unit labels to scan/select. Batch and+ // non-tracked make-methods must never surface the serial picker.+ if (!requiresSerialTracking) return;const uncompletedEntities = trackedEntities.filter((entity) =>isSerialEntityIncompleteForOperation(entity, operationId ?? ""));@@ -323,7 +331,13 @@ export function useOperation({serialModal.onOpen();}// causes an infinite loop on navigation- }, [trackedEntities, trackedEntityParam, operationId, isFirstOperation]);+ }, [+ trackedEntities,+ trackedEntityParam,+ operationId,+ isFirstOperation,+ requiresSerialTracking+ ]);return {active,diff --git a/packages/database/src/types.ts b/packages/database/src/types.tsindex 82ae43cb1d..593d65a3cd 100644--- a/packages/database/src/types.ts+++ b/packages/database/src/types.ts@@ -70156,14 +70156,14 @@ export type Database = {Relationships: [{foreignKeyName: "address_countryCode_fkey"- columns: ["shipmentCountryCode"]+ columns: ["customerCountryCode"]isOneToOne: falsereferencedRelation: "country"referencedColumns: ["alpha2"]},{foreignKeyName: "address_countryCode_fkey"- columns: ["customerCountryCode"]+ columns: ["shipmentCountryCode"]isOneToOne: falsereferencedRelation: "country"referencedColumns: ["alpha2"]diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.tsindex 82ae43cb1d..593d65a3cd 100644--- a/packages/database/supabase/functions/lib/types.ts+++ b/packages/database/supabase/functions/lib/types.ts@@ -70156,14 +70156,14 @@ export type Database = {Relationships: [{foreignKeyName: "address_countryCode_fkey"- columns: ["shipmentCountryCode"]+ columns: ["customerCountryCode"]isOneToOne: falsereferencedRelation: "country"referencedColumns: ["alpha2"]},{foreignKeyName: "address_countryCode_fkey"- columns: ["customerCountryCode"]+ columns: ["shipmentCountryCode"]isOneToOne: falsereferencedRelation: "country"referencedColumns: ["alpha2"]