Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
2514 Lượt xem

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

Ảnh đại diện
Huỷ bỏ

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

Câu trả lời hay nhất

Hi,

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

Ảnh đại diện
Huỷ bỏ