Skip to Content
Menu
This question has been flagged
1 Atsakyti
1968 Rodiniai

I need to sum the total quantity of several products by id, I have achieved only that the total quantity of all products in general is added, but I need to sum product by product and then show the total quantity of product 1 and the total quantity of product 2 and so on

Portretas
Atmesti
Best Answer

Hi,

You can use read_group function to achieve this

Example

order_line.read_group([], ["quantity", "product_id"], ["product_id"])

Regards

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
0
geg. 23
1878
1
birž. 22
2456
1
birž. 22
1570
1
bal. 24
1326
1
spal. 23
1465