mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Handle IntegrityError when saving PartPricing object (#6070)
This commit is contained in:
parent
9ecaea2c12
commit
5b547f777d
@ -2432,7 +2432,11 @@ class PartPricing(common.models.MetaMixin):
|
||||
# If something has happened to the Part model, might throw an error
|
||||
pass
|
||||
|
||||
super().save(*args, **kwargs)
|
||||
try:
|
||||
super().save(*args, **kwargs)
|
||||
except IntegrityError:
|
||||
# This error may be thrown if there is already duplicate pricing data
|
||||
pass
|
||||
|
||||
def update_bom_cost(self, save=True):
|
||||
"""Recalculate BOM cost for the referenced Part instance.
|
||||
|
Loading…
Reference in New Issue
Block a user