跳至内容
菜单
此问题已终结
1 回复
1936 查看

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

形象
丢弃
相关帖文 回复 查看 活动
0
5月 23
1842
1
6月 22
2400
1
6月 22
1535
1
4月 24
1298
1
10月 23
1439