Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3164 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
lis 21
11673
2
úno 17
3241
0
úno 17
2550
1
dub 15
8410
0
zář 23
41