Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
5993 Vues

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
Ignorer
Meilleure réponse

Try this

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

Avatar
Ignorer
Auteur

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

Publications associées Réponses Vues Activité
3
sept. 20
72329
1
sept. 19
3516
2
sept. 23
10091
1
avr. 22
2987
0
mars 15
5076