跳至内容
菜单
此问题已终结
1 回复
3048 查看

Hello guys !! its so URGENT 

For exemple , i have classes ( STUDENT and COURSES) , and each student can have many courses,  furthermore, i have button in form view of student , when i click , it show the list of courses, BUT i want that when i click on the button in the form view of student X, it show ONLY courses of student X . ( something like filter, domain, context .... i d'ont jnow what i have do ) 

Any suggestion ???? 

形象
丢弃
最佳答案

When you press that button it should  return a view. And for to that view you'd have to add a domain. Something like:

view = {
  'type': 'ir.actions.act_window',
  'res_model': 'course.course',
 'view_type': 'form',
'view_mode': 'tree',
'target': 'new',
'domain': "[('student_id', '=', %s)]" % (self.id),
}
return view
形象
丢弃
相关帖文 回复 查看 活动
1
11月 21
11495
2
2月 17
3124
0
1月 17
2458
1
4月 15
8253
0
9月 23
41