Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
4668 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore

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

Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
lug 25
2977
1
ott 24
2176
1
apr 24
2234
0
set 23
1734
1
giu 23
2193