Skip to Content
मेन्यू
This question has been flagged
1 Reply
5784 Views

I have a many2one field and I want to add a domain filter to it but I cannot get it to work even though it works as a search filter.


This is how I would like to filter it

[('res_id','=',production_id.id),('res_model','=',production_id._name)]


How can I apply this to a Many2one field?

Avatar
Discard
Best Answer

Try this

department_id=fields.Many2one('hr.department','Department',domain="[('company_id','=',campus_id)]")

Avatar
Discard
Author

I was sure I had tried that in the XML domain but I didn't think to try it in python with the quotations. Such a simple answer to a big headache but I am glad it worked! Thank you very much

Related Posts Replies Views Activity
3
सित॰ 20
72000
1
सित॰ 19
3261
2
सित॰ 23
9754
1
अप्रैल 22
2657
0
मार्च 15
4869