Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4084 มุมมอง

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


อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

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

thanks to all :)


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
เม.ย. 23
2719
2
ก.พ. 25
40421
2
พ.ย. 22
2804
1
ก.พ. 22
7836
2
ม.ค. 22
2769