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

Suppose i have two many2one field in one model link

'partner_id':fields.many2one('res.partner', 'Customer Name'),

'order_id':fields.many2one('sale.order', 'Sale Order Ref'),



Now Suppose i write onchange method for partner_id , Now how can i return list of sale order id in which partner is available.

means i want to return list of order_id once partner_id change.


How can i do . 

Ảnh đại diện
Huỷ bỏ

what is a purpose of returning list of ids from onchange method?

Tác giả

Based On partner_id i want in which sale order that partner is involve

no, I mean your field order_id is type of many2one, it means you'll need just one id for this field, but what you're going to do with list of ids? you can search for ids in the onchange function using search() function of orm... maybe you meant to use one2many instead of many2one for order_id (order_ids)?