Product List is ordered descending by stock
This commit is contained in:
parent
b3536c19f6
commit
8752cb5b09
|
@ -1166,7 +1166,7 @@ class ProductListMenu(Menu):
|
|||
def _execute(self):
|
||||
self.print_header()
|
||||
text = ''
|
||||
product_list = self.session.query(Product).filter(Product.hidden == False)
|
||||
product_list = self.session.query(Product).filter(Product.hidden == False).order_by(Product.stock.desc())
|
||||
total_value = 0
|
||||
for p in product_list:
|
||||
total_value += p.price*p.stock
|
||||
|
|
Loading…
Reference in New Issue