mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-03 05:48:47 +00:00
Ref: https://github.com/inventree/InvenTree/pull/7807#issuecomment-2287770192 (cherry picked from commit 697ab1653ac6d1566805dc4bdc911199ba1ee286) Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
parent
2abc6e08a6
commit
36ecd41695
@ -1105,6 +1105,7 @@ class SalesOrder(TotalPriceMixin, Order):
|
||||
|
||||
# Schedule pricing update for any referenced parts
|
||||
for line in self.lines.all():
|
||||
if line.part:
|
||||
line.part.schedule_pricing_update(create=True)
|
||||
|
||||
trigger_event('salesorder.completed', id=self.pk)
|
||||
|
@ -4510,6 +4510,7 @@ def update_pricing_after_edit(sender, instance, created, **kwargs):
|
||||
"""Callback function when a part price break is created or updated."""
|
||||
# Update part pricing *unless* we are importing data
|
||||
if InvenTree.ready.canAppAccessDatabase() and not InvenTree.ready.isImportingData():
|
||||
if instance.part:
|
||||
instance.part.schedule_pricing_update(create=True)
|
||||
|
||||
|
||||
@ -4526,6 +4527,7 @@ def update_pricing_after_delete(sender, instance, **kwargs):
|
||||
"""Callback function when a part price break is deleted."""
|
||||
# Update part pricing *unless* we are importing data
|
||||
if InvenTree.ready.canAppAccessDatabase() and not InvenTree.ready.isImportingData():
|
||||
if instance.part:
|
||||
instance.part.schedule_pricing_update(create=False)
|
||||
|
||||
|
||||
|
@ -2293,6 +2293,7 @@ def after_delete_stock_item(sender, instance: StockItem, **kwargs):
|
||||
)
|
||||
|
||||
# Schedule an update on parent part pricing
|
||||
if instance.part:
|
||||
instance.part.schedule_pricing_update(create=False)
|
||||
|
||||
|
||||
@ -2312,6 +2313,7 @@ def after_save_stock_item(sender, instance: StockItem, created, **kwargs):
|
||||
)
|
||||
|
||||
# Schedule an update on parent part pricing
|
||||
if instance.part:
|
||||
instance.part.schedule_pricing_update(create=True)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user