From 06d9f4f9820989206d268a61b73894871402acf2 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 16 Dec 2020 21:02:53 +1100 Subject: [PATCH] Bugfix for duplicate IPN checks when blank IPN is used --- InvenTree/part/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index ea26e5e5c7..cf0c92899a 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -594,7 +594,7 @@ class Part(MPTTModel): # User can decide whether duplicate IPN (Internal Part Number) values are allowed allow_duplicate_ipn = common.models.InvenTreeSetting.get_setting('PART_ALLOW_DUPLICATE_IPN') - if not allow_duplicate_ipn: + if self.IPN is not None and not allow_duplicate_ipn: parts = Part.objects.filter(IPN__iexact=self.IPN) parts = parts.exclude(pk=self.pk)