Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
5830 Vizualizări

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?

Imagine profil
Abandonează
Cel mai bun răspuns

Try this

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

Imagine profil
Abandonează
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 Răspunsuri Vizualizări Activitate
3
sept. 20
72060
1
sept. 19
3333
2
sept. 23
9824
1
apr. 22
2777
0
mar. 15
4936