From 2986f8d61a81ab2d53bb1b245b2691200f323e38 Mon Sep 17 00:00:00 2001 From: simonkuehling Date: Sun, 19 Feb 2023 21:17:00 +0100 Subject: [PATCH] clear IPN field when duplicating part and PART_ALLOW_DUPLICATE_IPN is False (#4359) (#4365) --- InvenTree/templates/js/translated/part.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/InvenTree/templates/js/translated/part.js b/InvenTree/templates/js/translated/part.js index 17449d9647..e4a92ae650 100644 --- a/InvenTree/templates/js/translated/part.js +++ b/InvenTree/templates/js/translated/part.js @@ -414,6 +414,11 @@ function duplicatePart(pk, options={}) { data.is_template = false; } + // Clear IPN field if PART_ALLOW_DUPLICATE_IPN is set to False + if (!global_settings['PART_ALLOW_DUPLICATE_IPN']) { + data.IPN = ''; + } + constructForm('{% url "api-part-list" %}', { method: 'POST', fields: fields,