Odoo Help

Welcome!

This community 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.

0

Odoo Onchange method return list of ids

By
Ashish Singh
on 5/8/15, 2:45 AM 416 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?

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

Temur
on 5/8/15, 4:06 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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