mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-01 04:56:45 +00:00
Bugfix for duplicate IPN checks when blank IPN is used
This commit is contained in:
parent
7df25df2af
commit
06d9f4f982
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user