on changes department_id i want corresponding semester_id this is the function which i am applying. But the return value is all the semester i want only those semester which related to department.
def on_change_dep(self, cr, uid, ids,dep_id, context=None):
vals = {}
if dep_id:
sem = self.pool.get('dep.semister').search(cr,uid,[('dep_id','=',dep_id)],context=None)
if sem:
for dep_sem_id in sem:
val=self.pool.get('dep.semister').browse(cr,uid,dep_sem_id)
if val:
vals.update({'semester_id':val.sem_id.id})
return {'value':vals}
return True
Using on change function with return type domain and value http://help.openerp.com/question/13900/how-to-return-a-domain-on-field-on-onchange-action/
hi prakash , using domain and value solution is not possible because semester_id and its corresponding department_id is stored in different model,where as if i use domain context then semester_id will find value from semester model where corresponding department is not stored .so if you have other solution please help me