From a1d54690c28b99d46430d0c8c92cb391140748d1 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 24 Sep 2021 12:35:28 +1000 Subject: [PATCH] Merge pull request #2075 from SchrodingersGat/default-supplier-fix Default supplier fix (cherry picked from commit b3c8bd777963be5589d2d5a4d572d9c48defe5d6) --- InvenTree/templates/js/translated/part.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/InvenTree/templates/js/translated/part.js b/InvenTree/templates/js/translated/part.js index 9abbd2a0b9..6e8c02c0b1 100644 --- a/InvenTree/templates/js/translated/part.js +++ b/InvenTree/templates/js/translated/part.js @@ -94,7 +94,12 @@ function partFields(options={}) { }, default_location: { }, - default_supplier: {}, + default_supplier: { + filters: { + part_detail: true, + supplier_detail: true, + } + }, default_expiry: { icon: 'fa-calendar-alt', }, @@ -315,6 +320,9 @@ function editPart(pk) { edit: true }); + // Filter supplied parts by the Part ID + fields.default_supplier.filters.part = pk; + var groups = partGroups({}); constructForm(url, { @@ -338,6 +346,9 @@ function duplicatePart(pk, options={}) { duplicate: pk, }); + // Remove "default_supplier" field + delete fields['default_supplier']; + // If we are making a "variant" part if (options.variant) {