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(sales): drop assemblyInstructionStepId when copying method steps into quoteOperationStep (#1361)

Brad Barbinb2d1c19f0212
diff --git a/packages/database/supabase/functions/get-method/index.ts b/packages/database/supabase/functions/get-method/index.ts
index aa3cb9a696..958f6b8ade 100644
--- a/packages/database/supabase/functions/get-method/index.ts
+++ b/packages/database/supabase/functions/get-method/index.ts
@@ -2464,7 +2464,12 @@ serve(async (req: Request) => {
) {
const attributes = await Promise.all(
methodOperationStep.map(
- async ({ id, ...attribute }) => ({
+ async ({
+ id,
+ // quoteOperationStep has no provenance marker
+ assemblyInstructionStepId: _assemblyInstructionStepId,
+ ...attribute
+ }) => ({
...attribute,
description: toTiptapDoc(attribute.description),
operationId,
@@ -2992,7 +2997,13 @@ serve(async (req: Request) => {
.insertInto("quoteOperationStep")
.values(
methodOperationStep.map(
- ({ id: _id, ...attribute }) => ({
+ ({
+ id: _id,
+ // quoteOperationStep has no provenance marker
+ assemblyInstructionStepId:
+ _assemblyInstructionStepId,
+ ...attribute
+ }) => ({
...attribute,
description: toTiptapDoc(attribute.description),
operationId,