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: confirm before unlinking job from sales order (#800)

Siddharth Gaikwad9c5dd8e56577
diff --git a/apps/erp/app/modules/production/ui/Jobs/JobProperties.tsx b/apps/erp/app/modules/production/ui/Jobs/JobProperties.tsx
index 1bf70db2c3..27031198ca 100644
--- a/apps/erp/app/modules/production/ui/Jobs/JobProperties.tsx
+++ b/apps/erp/app/modules/production/ui/Jobs/JobProperties.tsx
@@ -10,10 +10,18 @@ import {
Badge,
Button,
HStack,
+ Modal,
+ ModalBody,
+ ModalContent,
+ ModalFooter,
+ ModalHeader,
+ ModalOverlay,
+ ModalTitle,
Tooltip,
TooltipContent,
TooltipTrigger,
toast,
+ useDisclosure,
VStack
} from "@carbon/react";
import { Trans, useLingui } from "@lingui/react/macro";
@@ -60,6 +68,8 @@ const JobProperties = () => {
trackedEntities: Promise<PostgrestResponse<TrackedEntity>>;
}>(path.to.job(jobId));
+ const unlinkDisclosure = useDisclosure();
+
const fetcher = useFetcher<typeof action>();
useEffect(() => {
if (fetcher.data?.error) {
@@ -297,9 +307,7 @@ const JobProperties = () => {
variant="ghost"
size="sm"
leftIcon={<LuUnlink2 className="w-3 h-3" />}
- onClick={() => {
- onUpdate("salesOrderLineId", null);
- }}
+ onClick={unlinkDisclosure.onOpen}
>
Unlink
</Button>
@@ -569,6 +577,48 @@ const JobProperties = () => {
tags={routeData?.job.tags ?? []}
onUpdate={onUpdateCustomFields}
/>
+
+ {unlinkDisclosure.isOpen && (
+ <Modal
+ open={unlinkDisclosure.isOpen}
+ onOpenChange={(open) => {
+ if (!open) unlinkDisclosure.onClose();
+ }}
+ >
+ <ModalOverlay />
+ <ModalContent>
+ <ModalHeader>
+ <ModalTitle>
+ <Trans>Unlink job from sales order?</Trans>
+ </ModalTitle>
+ </ModalHeader>
+ <ModalBody>
+ <p className="text-sm text-muted-foreground">
+ <Trans>
+ This will remove {routeData?.job?.jobId}'s link to{" "}
+ {routeData?.job?.salesOrderReadableId}. The job will no longer
+ appear under the sales order and shipments won't find it.
+ </Trans>
+ </p>
+ </ModalBody>
+ <ModalFooter>
+ <Button variant="secondary" onClick={unlinkDisclosure.onClose}>
+ <Trans>Cancel</Trans>
+ </Button>
+ <Button
+ variant="destructive"
+ leftIcon={<LuUnlink2 className="w-3 h-3" />}
+ onClick={() => {
+ onUpdate("salesOrderLineId", null);
+ unlinkDisclosure.onClose();
+ }}
+ >
+ <Trans>Unlink</Trans>
+ </Button>
+ </ModalFooter>
+ </ModalContent>
+ </Modal>
+ )}
</VStack>
);
};
diff --git a/packages/locale/locales/de/erp.po b/packages/locale/locales/de/erp.po
index 46911c2c4e..109432f69f 100644
--- a/packages/locale/locales/de/erp.po
+++ b/packages/locale/locales/de/erp.po
@@ -7526,6 +7526,11 @@ msgstr "Dies wird die vorhandene Angebotsmethode überschreiben"
msgid "This will recalculate the unit cost from the active make method's bill of materials and processes using the batch size. The current cost will be overwritten. Do you want to continue?"
msgstr "Dies wird die Stückkosten aus der aktiven Herstellungsmethode, deren Stückliste und Prozesse unter Verwendung der Chargengröße neu berechnen. Die aktuellen Kosten werden überschrieben. Möchten Sie fortfahren?"
+#. placeholder {0}: routeData?.job?.jobId
+#. placeholder {1}: routeData?.job?.salesOrderReadableId
+msgid "This will remove {0}'s link to {1}. The job will no longer appear under the sales order and shipments won't find it."
+msgstr ""
+
msgid "This will replace all method materials of other revisions with this revision."
msgstr "Dies ersetzt alle Methodenmaterialien anderer Revisionen durch diese Revision."
@@ -7817,6 +7822,9 @@ msgstr "Unbegrenzte funktionale Unterstützung"
msgid "Unlink"
msgstr "Verknüpfung aufheben"
+msgid "Unlink job from sales order?"
+msgstr ""
+
msgid "Unsupported source document type: {sourceDocument}"
msgstr "Nicht unterstützter Quelldokumenttyp: {sourceDocument}"
diff --git a/packages/locale/locales/en/erp.po b/packages/locale/locales/en/erp.po
index 374f8099c6..f982bedc4c 100644
--- a/packages/locale/locales/en/erp.po
+++ b/packages/locale/locales/en/erp.po
@@ -7526,6 +7526,11 @@ msgstr "This will overwrite the existing quote method"
msgid "This will recalculate the unit cost from the active make method's bill of materials and processes using the batch size. The current cost will be overwritten. Do you want to continue?"
msgstr "This will recalculate the unit cost from the active make method's bill of materials and processes using the batch size. The current cost will be overwritten. Do you want to continue?"
+#. placeholder {0}: routeData?.job?.jobId
+#. placeholder {1}: routeData?.job?.salesOrderReadableId
+msgid "This will remove {0}'s link to {1}. The job will no longer appear under the sales order and shipments won't find it."
+msgstr "This will remove {0}'s link to {1}. The job will no longer appear under the sales order and shipments won't find it."
+
msgid "This will replace all method materials of other revisions with this revision."
msgstr "This will replace all method materials of other revisions with this revision."
@@ -7817,6 +7822,9 @@ msgstr "Unlimited Functional Support"
msgid "Unlink"
msgstr "Unlink"
+msgid "Unlink job from sales order?"
+msgstr "Unlink job from sales order?"
+
msgid "Unsupported source document type: {sourceDocument}"
msgstr "Unsupported source document type: {sourceDocument}"
diff --git a/packages/locale/locales/es/erp.po b/packages/locale/locales/es/erp.po
index fe66a158e2..673e20a113 100644
--- a/packages/locale/locales/es/erp.po
+++ b/packages/locale/locales/es/erp.po
@@ -7526,6 +7526,11 @@ msgstr "Esto sobrescribirá el método de cotiza
msgid "This will recalculate the unit cost from the active make method's bill of materials and processes using the batch size. The current cost will be overwritten. Do you want to continue?"
msgstr "Esto recalculará el costo unitario del método de fabricación activo basándose en la lista de materiales y procesos utilizando el tamaño de lote. El costo actual será sobrescrito. ¿Deseas continuar?"
+#. placeholder {0}: routeData?.job?.jobId
+#. placeholder {1}: routeData?.job?.salesOrderReadableId
+msgid "This will remove {0}'s link to {1}. The job will no longer appear under the sales order and shipments won't find it."
+msgstr ""
+
msgid "This will replace all method materials of other revisions with this revision."
msgstr "Esto reemplazará todos los materiales de método de otras revisiones con esta revisión."
@@ -7817,6 +7822,9 @@ msgstr "Soporte Funcional Ilimitado"
msgid "Unlink"
msgstr "Desenlazar"
+msgid "Unlink job from sales order?"
+msgstr ""
+
msgid "Unsupported source document type: {sourceDocument}"
msgstr "Tipo de documento de origen no compatible: {sourceDocument}"
diff --git a/packages/locale/locales/fr/erp.po b/packages/locale/locales/fr/erp.po
index 2a6a194b18..a675133e56 100644
--- a/packages/locale/locales/fr/erp.po
+++ b/packages/locale/locales/fr/erp.po
@@ -7526,6 +7526,11 @@ msgstr "Cela remplacera la méthode de devis existante"
msgid "This will recalculate the unit cost from the active make method's bill of materials and processes using the batch size. The current cost will be overwritten. Do you want to continue?"
msgstr "Cela recalculera le coût unitaire à partir de la nomenclature et des processus de la méthode de fabrication active en utilisant la taille du lot. Le coût actuel sera remplacé. Voulez-vous continuer ?"
+#. placeholder {0}: routeData?.job?.jobId
+#. placeholder {1}: routeData?.job?.salesOrderReadableId
+msgid "This will remove {0}'s link to {1}. The job will no longer appear under the sales order and shipments won't find it."
+msgstr ""
+
msgid "This will replace all method materials of other revisions with this revision."
msgstr "Cela remplacera tous les matériaux de méthode des autres révisions par cette révision."
@@ -7817,6 +7822,9 @@ msgstr "Support fonctionnel illimité"
msgid "Unlink"
msgstr "Dissocier"
+msgid "Unlink job from sales order?"
+msgstr ""
+
msgid "Unsupported source document type: {sourceDocument}"
msgstr "Type de document source non pris en charge : {sourceDocument}"
diff --git a/packages/locale/locales/hi/erp.po b/packages/locale/locales/hi/erp.po
index 9f899af500..548955622c 100644
--- a/packages/locale/locales/hi/erp.po
+++ b/packages/locale/locales/hi/erp.po
@@ -7526,6 +7526,11 @@ msgstr "यह à¤Ã
msgid "This will recalculate the unit cost from the active make method's bill of materials and processes using the batch size. The current cost will be overwritten. Do you want to continue?"
msgstr "यह सक्रिय निर्माण विधि के सामग्री विवरण और प्रक्रियाओं से बैच आकार का उपयोग करके इकाई लागत की पुनः गणना करेगा। वर्तमान लागत को अधिलेखित किया जाएगा। क्या आप जारी रखना चाहते हैं?"
+#. placeholder {0}: routeData?.job?.jobId
+#. placeholder {1}: routeData?.job?.salesOrderReadableId
+msgid "This will remove {0}'s link to {1}. The job will no longer appear under the sales order and shipments won't find it."
+msgstr ""
+
msgid "This will replace all method materials of other revisions with this revision."
msgstr "यह अन्य संशोधनों की सभी विधि सामग्री को इस संशोधन से बदल देगा।"
@@ -7817,6 +7822,9 @@ msgstr "असàÂ
msgid "Unlink"
msgstr "अनलिंक करें"
+msgid "Unlink job from sales order?"
+msgstr ""
+
msgid "Unsupported source document type: {sourceDocument}"
msgstr "असमर्थित स्रोत दस्तावेज़ प्रकार: {sourceDocument}"
diff --git a/packages/locale/locales/it/erp.po b/packages/locale/locales/it/erp.po
index 4027900791..595b45d801 100644
--- a/packages/locale/locales/it/erp.po
+++ b/packages/locale/locales/it/erp.po
@@ -7526,6 +7526,11 @@ msgstr "Questo sovrascriverà il metodo di preventivo esistente"
msgid "This will recalculate the unit cost from the active make method's bill of materials and processes using the batch size. The current cost will be overwritten. Do you want to continue?"
msgstr "Questo ricalcolerà il costo unitario dal distinta base e dai processi del metodo di produzione attivo utilizzando la dimensione del lotto. Il costo attuale verrà sovrascritto. Vuoi continuare?"
+#. placeholder {0}: routeData?.job?.jobId
+#. placeholder {1}: routeData?.job?.salesOrderReadableId
+msgid "This will remove {0}'s link to {1}. The job will no longer appear under the sales order and shipments won't find it."
+msgstr ""
+
msgid "This will replace all method materials of other revisions with this revision."
msgstr "Questo sostituirà tutti i materiali del metodo di altre revisioni con questa revisione."
@@ -7817,6 +7822,9 @@ msgstr "Supporto Funzionale Illimitato"
msgid "Unlink"
msgstr "Scollega"
+msgid "Unlink job from sales order?"
+msgstr ""
+
msgid "Unsupported source document type: {sourceDocument}"
msgstr "Tipo di documento di origine non supportato: {sourceDocument}"
diff --git a/packages/locale/locales/ja/erp.po b/packages/locale/locales/ja/erp.po
index ead63a1291..331c2578b0 100644
--- a/packages/locale/locales/ja/erp.po
+++ b/packages/locale/locales/ja/erp.po
@@ -7526,6 +7526,11 @@ msgstr "これÃ
msgid "This will recalculate the unit cost from the active make method's bill of materials and processes using the batch size. The current cost will be overwritten. Do you want to continue?"
msgstr "これにより、アクティブな製造方法の部品表とプロセスからバッチサイズを使用して単価が再計算されます。現在のコストは上書きされます。続行しますか?"
+#. placeholder {0}: routeData?.job?.jobId
+#. placeholder {1}: routeData?.job?.salesOrderReadableId
+msgid "This will remove {0}'s link to {1}. The job will no longer appear under the sales order and shipments won't find it."
+msgstr ""
+
msgid "This will replace all method materials of other revisions with this revision."
msgstr "これにより、他のリビジョンのすべてのメソッドマテリアルがこのリビジョンに置き換わります。"
@@ -7817,6 +7822,9 @@ msgstr "無制éÃ
msgid "Unlink"
msgstr "リンク解除"
+msgid "Unlink job from sales order?"
+msgstr ""
+
msgid "Unsupported source document type: {sourceDocument}"
msgstr "サポートされていないソースドキュメントタイプ: {sourceDocument}"
diff --git a/packages/locale/locales/pl/erp.po b/packages/locale/locales/pl/erp.po
index cc183a997d..b8da1bd0c0 100644
--- a/packages/locale/locales/pl/erp.po
+++ b/packages/locale/locales/pl/erp.po
@@ -7526,6 +7526,11 @@ msgstr "To spowoduje zastÄ…pienie istniejÄâ
msgid "This will recalculate the unit cost from the active make method's bill of materials and processes using the batch size. The current cost will be overwritten. Do you want to continue?"
msgstr "To spowoduje przeliczenie kosztu jednostkowego na podstawie aktywnej metody produkcji, listy materiałów i procesów przy użyciu wielkości partii. Bieżący koszt zostanie zastąpiony. Czy chcesz kontynuować?"
+#. placeholder {0}: routeData?.job?.jobId
+#. placeholder {1}: routeData?.job?.salesOrderReadableId
+msgid "This will remove {0}'s link to {1}. The job will no longer appear under the sales order and shipments won't find it."
+msgstr ""
+
msgid "This will replace all method materials of other revisions with this revision."
msgstr "To zastąpi wszystkie materiały metody innych wersji tą wersją."
@@ -7817,6 +7822,9 @@ msgstr "Nieograniczone wsparcie funkcjonalne"
msgid "Unlink"
msgstr "Odłącz"
+msgid "Unlink job from sales order?"
+msgstr ""
+
msgid "Unsupported source document type: {sourceDocument}"
msgstr "Nieobsługiwany typ dokumentu źródłowego: {sourceDocument}"
diff --git a/packages/locale/locales/pt/erp.po b/packages/locale/locales/pt/erp.po
index f4adf6a1f6..2ff94b83a4 100644
--- a/packages/locale/locales/pt/erp.po
+++ b/packages/locale/locales/pt/erp.po
@@ -7526,6 +7526,11 @@ msgstr "Isto irá sobrescrever o método de cota
msgid "This will recalculate the unit cost from the active make method's bill of materials and processes using the batch size. The current cost will be overwritten. Do you want to continue?"
msgstr "Isto irá recalcular o custo unitário a partir da lista de materiais e processos do método de fabricação ativo usando o tamanho do lote. O custo atual será sobrescrito. Deseja continuar?"
+#. placeholder {0}: routeData?.job?.jobId
+#. placeholder {1}: routeData?.job?.salesOrderReadableId
+msgid "This will remove {0}'s link to {1}. The job will no longer appear under the sales order and shipments won't find it."
+msgstr ""
+
msgid "This will replace all method materials of other revisions with this revision."
msgstr "Isto substituirá todos os materiais de método de outras revisões por esta revisão."
@@ -7817,6 +7822,9 @@ msgstr "Suporte Funcional Ilimitado"
msgid "Unlink"
msgstr "Desvinculação"
+msgid "Unlink job from sales order?"
+msgstr ""
+
msgid "Unsupported source document type: {sourceDocument}"
msgstr "Tipo de documento de origem não suportado: {sourceDocument}"
diff --git a/packages/locale/locales/ru/erp.po b/packages/locale/locales/ru/erp.po
index f70d150487..5af99a39d8 100644
--- a/packages/locale/locales/ru/erp.po
+++ b/packages/locale/locales/ru/erp.po
@@ -7526,6 +7526,11 @@ msgstr "Это ÐÃ
msgid "This will recalculate the unit cost from the active make method's bill of materials and processes using the batch size. The current cost will be overwritten. Do you want to continue?"
msgstr "Это пересчитает себестоимость единицы продукции на основе активного метода производства, спецификации материалов и процессов с использованием размера партии. Текущая себестоимость будет перезаписана. Вы хотите продолжить?"
+#. placeholder {0}: routeData?.job?.jobId
+#. placeholder {1}: routeData?.job?.salesOrderReadableId
+msgid "This will remove {0}'s link to {1}. The job will no longer appear under the sales order and shipments won't find it."
+msgstr ""
+
msgid "This will replace all method materials of other revisions with this revision."
msgstr "Это заменит все материалы методов других редакций на эту редакцию."
@@ -7817,6 +7822,9 @@ msgstr "НеогÃ
msgid "Unlink"
msgstr "Отменить связь"
+msgid "Unlink job from sales order?"
+msgstr ""
+
msgid "Unsupported source document type: {sourceDocument}"
msgstr "Неподдерживаемый тип исходного документа: {sourceDocument}"
diff --git a/packages/locale/locales/zh/erp.po b/packages/locale/locales/zh/erp.po
index 2455f0056d..5139ba9900 100644
--- a/packages/locale/locales/zh/erp.po
+++ b/packages/locale/locales/zh/erp.po
@@ -7526,6 +7526,11 @@ msgstr "这将è
msgid "This will recalculate the unit cost from the active make method's bill of materials and processes using the batch size. The current cost will be overwritten. Do you want to continue?"
msgstr "这将根据活跃制造方法的物料清单和工艺流程使用批量大小重新计算单位成本。当前成本将被覆盖。您要继续吗?"
+#. placeholder {0}: routeData?.job?.jobId
+#. placeholder {1}: routeData?.job?.salesOrderReadableId
+msgid "This will remove {0}'s link to {1}. The job will no longer appear under the sales order and shipments won't find it."
+msgstr ""
+
msgid "This will replace all method materials of other revisions with this revision."
msgstr "这将用此修订版本替换其他修订版本的所有方法材料。"
@@ -7817,6 +7822,9 @@ msgstr "无限Ã
msgid "Unlink"
msgstr "取消链接"
+msgid "Unlink job from sales order?"
+msgstr ""
+
msgid "Unsupported source document type: {sourceDocument}"
msgstr "不支持的源文档类型:{sourceDocument}"