Skip to Content
Menú
This question has been flagged
1 Respondre
2959 Vistes

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 ???? 

Avatar
Descartar
Best Answer

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
Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de nov. 21
11284
2
de febr. 17
3033
0
de gen. 17
2414
1
d’abr. 15
8143
0
de set. 23
41