mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	only process purchase_price if prices present
This commit is contained in:
		| @@ -1652,8 +1652,10 @@ class Part(MPTTModel): | ||||
|  | ||||
|     def get_purchase_price(self, quantity): | ||||
|         currency = currency_code_default() | ||||
|         prices = [convert_money(item.purchase_price, currency).amount for item in self.stock_items.all()] | ||||
|         return min(prices) * quantity, max(prices) * quantity | ||||
|         prices = [convert_money(item.purchase_price, currency).amount for item in self.stock_items.all() if item.purchase_price] | ||||
|         if prices: | ||||
|             return min(prices) * quantity, max(prices) * quantity | ||||
|         return None | ||||
|  | ||||
|     @transaction.atomic | ||||
|     def copy_bom_from(self, other, clear=True, **kwargs): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user