Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
2021 Visualizzazioni

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
Abbandona
Risposta migliore

Hi,

You can use read_group function to achieve this

Example

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

Regards

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
mag 23
1906
1
giu 22
2553
1
giu 22
1653
1
apr 24
1376
1
ott 23
1538