Skip to Content
Menu
This question has been flagged
2 Replies
4073 Views

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 )] )

Avatar
Discard
Best Answer

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)])
Avatar
Discard
Author

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

Best Answer

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

Avatar
Discard
Related Posts Replies Views Activity
1
Oct 24
266
1
Apr 24
508
2
Mar 24
734
0
Sep 23
575
1
Jun 23
817