Skip to content

Commit

Permalink
Check for div-by-zero
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Jun 29, 2024
1 parent 56c0617 commit fce7a86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/backend/InvenTree/stock/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,8 @@ def merge_stock_items(self, other_items, raise_error=False, **kwargs):
# Skip this entry, cannot convert to base currency
continue

self.purchase_price = total_price / quantity
if quantity > 0:
self.purchase_price = total_price / quantity

self.save()

Expand Down

0 comments on commit fce7a86

Please sign in to comment.