Odoo Help


Odoo Onchange method return list of ids

Ashish Singh
on 5/8/15, 2:45 AM 720 views

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 . 

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

on 5/8/15, 3:41 AM

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

Ashish Singh
on 5/8/15, 3:46 AM

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

on 5/8/15, 4:06 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 5/8/15, 2:45 AM
Seen: 720 times
Last updated: 5/8/15, 4:06 AM