mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
refactor
This commit is contained in:
parent
59aae51652
commit
a0b83d530c
@ -814,7 +814,7 @@ class PartPricingView(PartDetail):
|
|||||||
part = self.get_part()
|
part = self.get_part()
|
||||||
# Stock history
|
# Stock history
|
||||||
if part.total_stock > 1:
|
if part.total_stock > 1:
|
||||||
ret = []
|
price_history = []
|
||||||
stock = part.stock_entries(include_variants=False, in_stock=True) # .order_by('purchase_order__date')
|
stock = part.stock_entries(include_variants=False, in_stock=True) # .order_by('purchase_order__date')
|
||||||
stock = stock.prefetch_related('purchase_order', 'supplier_part')
|
stock = stock.prefetch_related('purchase_order', 'supplier_part')
|
||||||
|
|
||||||
@ -841,9 +841,9 @@ class PartPricingView(PartDetail):
|
|||||||
line['date'] = stock_item.purchase_order.issue_date.strftime('%d.%m.%Y')
|
line['date'] = stock_item.purchase_order.issue_date.strftime('%d.%m.%Y')
|
||||||
else:
|
else:
|
||||||
line['date'] = stock_item.tracking_info.first().date.strftime('%d.%m.%Y')
|
line['date'] = stock_item.tracking_info.first().date.strftime('%d.%m.%Y')
|
||||||
ret.append(line)
|
price_history.append(line)
|
||||||
|
|
||||||
ctx['price_history'] = ret
|
ctx['price_history'] = price_history
|
||||||
|
|
||||||
# BOM Information for Pie-Chart
|
# BOM Information for Pie-Chart
|
||||||
if part.has_bom:
|
if part.has_bom:
|
||||||
|
Loading…
Reference in New Issue
Block a user