2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-29 18:20:53 +00:00

Fix pricing bug

- Include BOM item pricing in API
This commit is contained in:
Oliver Walters
2019-05-18 21:43:52 +10:00
parent 2a1fd2b03b
commit 2b098942b0
3 changed files with 10 additions and 3 deletions
InvenTree
part
static
script
inventree

@ -636,7 +636,7 @@ class Part(models.Model):
if min_price is None:
return None
else:
return min_price * quantity
return min_price
def get_max_supplier_price(self, quantity=1):
""" Return the maximum price of this part from all available suppliers.
@ -662,7 +662,7 @@ class Part(models.Model):
if max_price is None:
return None
else:
return max_price * quantity
return max_price
def get_min_bom_price(self, quantity=1):
""" Return the minimum price of the BOM for this part.
@ -989,3 +989,8 @@ class BomItem(models.Model):
base_quantity = self.quantity * build_quantity
return base_quantity + self.get_overage_quantity(base_quantity)
@property
def price_info(self):
""" Return the price for this item in the BOM """
return self.sub_part.get_price_info(self.quantity)