[Fixed]-Django: A serious issue or is there a way around?

1👍

You haven’t shown what inventory_movement is or how you’re building it up. But surely you just need to add the right elements from each annotation:

inventory_movement = []
for (p, s, pr, sr) in zip(purchase, sale, purchase_return, sales_return):
    invoices = {}
    invoices['purchase'] = p.purchase
    invoices['sale'] = s.sale
    invoices['purchase_return'] = pr.purchase_return
    invoices['sales_return'] = sr.sales_return
    inventory_movement.append(invoices)

Leave a comment