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

hi all,

I have a model (child) which contains a field named 'mparent', it stores 'name' field values ​​from its parent

have another Many2one field which point to itself to select records from

I have to filter this Many2one field with values ​​are in 'mparent', so the only related data will be present to user to select one

i did something like below but it shows error at runtime (here Household is the value mparent field contains): ValueError: Invalid domain term ('mparent', 'in', 'Household') 


in my mdel:

    sparent = fields.Many2one ('mymodel.subcat', string = "Sel Parent", domain = "[('mparent', 'in', mparent)]")


please help, how to do this?

looks


Avatar
Descartar
Autor Best Answer

its done, removed 'in' and used '=' in domain, now it works fine.

thanks to all :)


Avatar
Descartar
Related Posts Respostes Vistes Activitat
2
d’abr. 23
2710
2
de febr. 25
40393
2
de nov. 22
2792
1
de febr. 22
7815
2
de gen. 22
2766