Skip to Content
Menú
This question has been flagged
1 Respondre
5704 Vistes

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
Descartar
Best Answer

Try this

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

Avatar
Descartar
Autor

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 Respostes Vistes Activitat
3
de set. 20
71906
1
de set. 19
3157
2
de set. 23
9628
1
d’abr. 22
2540
0
de març 15
4799