Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
2034 Näkymät

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

Avatar
Hylkää
Paras vastaus

Hi,

You can use read_group function to achieve this

Example

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

Regards

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
toukok. 23
1910
1
kesäk. 22
2574
1
kesäk. 22
1685
1
huhtik. 24
1380
1
lokak. 23
1569