Odoo Help


How to create dynamic domain on many2one fields with onchange function?

on 9/11/13, 6:25 AM 2,602 views

two fields many2one both are different form form-1 1.plan_category plan-1 plan-2 form-2 2.sub_pan sub plan-1 sub plan-2

in third form select plan category in onchange event on display subplan


Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
--Ahmed M.Elmubarak--

Ahmed M.Elmubarak
On 9/11/13, 8:15 AM


I just understood the title :D,

So, the onchange function can return a domain like:

res = {'domain': {'field_name': [domain like ('id', 'in', list_of_ids)]}}
return res

So every time this function is called you can do your calculation and pass the result to the domain...

I hope this could helps you ...


thanks sir

on 9/13/13, 5:16 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 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

0 follower(s)


Asked: 9/11/13, 6:25 AM
Seen: 2602 times
Last updated: 3/27/15, 8:14 PM