跳至內容
選單
此問題已被標幟
2 回覆
4665 瀏覽次數

I am trying to search for records in account.move.line by partner_ids. I'm first searching the res.partner table and then  passing the ids from that search into the account_move_line_ids search but I get an error "INVALID LEAF". Can someone help me understand whats going wrong?


supplier_ids = sock.execute( dbname, uid, pwd, 'res.partner', 'search', [( 'supplier', '=', True ), '|', ( 'active', '=', True ), ( 'active', '=', False )] )
account_move_line_ids = sock.execute( dbname, uid, pwd, 'account.move.line', 'search', [( 'partner_id', 'IN', supplier_ids )] )

頭像
捨棄
最佳答案

Hi Jesse,

You must use 'in' instead of 'IN' as,

account_move_line_ids = sock.execute(dbname,uid,pwd,'account.move.line','search',[('partner_id','in',supplier_ids)])
頭像
捨棄
作者

Thanks. I knew I was missing something simple never thought to change the case of IN. :(

最佳答案

Hello jesse Rye

can you try like

supplier_ids = sock.execute( dbname, uid, pwd, 'res.partner', 'search', [( 'supplier', '=', True ), '|', ( 'active', '=', True ), ( 'active', '=', False )] )

 move_id = []

for move in supplier_ids:
           id = sock.execute( dbname, uid, pwd, 'account.move.line', 'search', [( 'partner_id', 'IN', move )] ).id
          move_id.append(id)

print "===========", move_id

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
7月 25
2976
1
10月 24
2173
1
4月 24
2233
0
9月 23
1734
1
6月 23
2193