Product List is ordered descending by stock

This commit is contained in:
robertem 2017-02-05 00:01:27 +00:00
parent b3536c19f6
commit 8752cb5b09
1 changed files with 1 additions and 1 deletions

View File

@ -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