mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix for update_pricing method: (#7075)
- Specify currency - Handle case where quantity is zero
This commit is contained in:
parent
9a16a73ad3
commit
50ca493667
@ -1459,9 +1459,11 @@ class PurchaseOrderLineItem(OrderLineItem):
|
||||
def update_pricing(self):
|
||||
"""Update pricing information based on the supplier part data."""
|
||||
if self.part:
|
||||
price = self.part.get_price(self.quantity)
|
||||
price = self.part.get_price(
|
||||
self.quantity, currency=self.purchase_price_currency
|
||||
)
|
||||
|
||||
if price is None:
|
||||
if price is None or self.quantity == 0:
|
||||
return
|
||||
|
||||
self.purchase_price = Decimal(price) / Decimal(self.quantity)
|
||||
|
Loading…
Reference in New Issue
Block a user