+ def _get_bikecoop_theme_type(self, cr, uid, ids, name, args, context=None):
+ """Return themes type for selected partners"""
+ res = {}
+ partners = self.browse(cr, uid, ids, context=context)
+ for partner in partners:
+ res[partner.id] = False
+ if partner.occupation_id.type == 'studies':
+ res[partner.id] = True
+ return res
+
+ def onchange_occupation_id(self, cr, uid, ids, occupation_id):
+ """Define if a partner is a student based on his/her occupation type"""
+ v = {}
+ partners = self.browse(cr, uid, ids)
+ occupations = self.pool.get('bikecoop.partner.theme')
+ for partner in partners:
+ v['is_student'] = False
+ occupation = occupations.browse(cr, uid, occupation_id)
+ if occupation.type == 'studies':
+ v['is_student'] = True
+ return {'value': v}
+