跳至內容
選單
此問題已被標幟
2 回覆
2510 瀏覽次數

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')

頭像
捨棄