Fixed: Issues were negative in Stock Movement

This commit is contained in:
Amritanshu 2013-10-14 15:16:21 +05:30
parent 8df9298724
commit 2c714dfe98
1 changed files with 2 additions and 2 deletions

View File

@ -64,10 +64,10 @@ def build_stock_movement(start_date, finish_date):
.group_by(Product).all()
for product, quantity in issues:
if product.id in dict:
dict[product.id]['Issue'] = quantity
dict[product.id]['Issue'] = quantity * -1
else:
dict[product.id] = {'ProductID': product.id, 'Name': product.full_name, 'Group': product.product_group.name,
'Issue': quantity}
'Issue': quantity * -1}
list = [value for key, value in dict.items()]
list = sorted(list, key=lambda x: x['Name'].lower())