コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3076 ビュー

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
11537
2
2月 17
3166
0
1月 17
2470
1
4月 15
8305
0
9月 23
41