コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
17164 ビュー


Hello,

with this expression:

self.env['sale.order'].read_group([], fields=['partner_id','user_id'], groupby=['partner_id','user_id'])


how can i get the same result of SQL query:

SELECT  partner_id,user_id 
FROM sale_order
GROUP BY partner_id,user_id


In the first expression Odoo doens't group by "user_id" but only by "partner_id"


Odoo11 community

アバター
破棄
最善の回答

hi,

Just noticed your case, Try below code

self.env['sale.order'].read_group([], fields=['partner_id','user_id'], groupby=['partner_id','user_id'],lazy=False)

By adding lazy=False will consider your user_id in group by
アバター
破棄
関連投稿 返信 ビュー 活動
3
10月 23
21900
2
7月 24
2283
2
5月 24
2414
1
2月 24
1803
1
11月 22
5585