Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
4660 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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)])
Ảnh đại diện
Huỷ bỏ
Tác giả

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

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 7 25
2975
1
thg 10 24
2173
1
thg 4 24
2232
0
thg 9 23
1733
1
thg 6 23
2193