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

hi

i have two fields like

class_name = fields.Many2one('class.name')

students = fields.Many2one('all.class.student', string ="Students" , related='class_name.name')

here if i select class name like 12th class then automatically only 12th class students should display but i give filter in code but thats not working,my code displaying whole classes's students name

อวตาร
ละทิ้ง

why you have create it , related='class_name.name' name is the character fields

คำตอบที่ดีที่สุด

Hi,

students = fields.Many2one('all.class.student', string ="Students" , related='class_name.YOUR MANY2ONE FIELD')

อวตาร
ละทิ้ง