fix: dynamically filter fifo queue

This commit is contained in:
Mangesh-Khairnar 2019-10-03 19:19:42 +05:30
parent 77f22635f2
commit ea70c6f696

View File

@ -13,11 +13,12 @@ def execute(filters=None):
columns = get_columns(filters)
item_details = get_fifo_queue(filters)
to_date = filters["to_date"]
_func = lambda x: x[1]
data = []
for item, item_dict in iteritems(item_details):
item_dict['fifo_queue'] = [item for item in item_dict if item[1]]
fifo_queue = sorted(item_dict["fifo_queue"], key=lambda x: x[1])
fifo_queue = sorted(filter(_func, item_dict["fifo_queue"]), key=_func)
details = item_dict["details"]
if not fifo_queue or (not item_dict.get("total_qty")): continue