Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
5960 Weergaven

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
Annuleer
Beste antwoord

Try this

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

Avatar
Annuleer
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

Gerelateerde posts Antwoorden Weergaven Activiteit
3
sep. 20
72283
1
sep. 19
3467
2
sep. 23
10031
1
apr. 22
2949
0
mrt. 15
5050