Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
1944 Переглядів

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

Аватар
Відмінити
Найкраща відповідь

Hi,

You can use read_group function to achieve this

Example

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

Regards

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
трав. 23
1849
1
черв. 22
2432
1
черв. 22
1546
1
квіт. 24
1307
1
жовт. 23
1447