Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
2 Besvarelser
4513 Visninger

i have this 

res['domain']=

{'grade_ids':[('cadre_id', '=',self.cadre_id.id)], 

 'employee_ids':[('shift_line_ids.cadre_id','=',self.cadre_id.id)]}


i want this 

i need to Append/update  ,('shift_line_ids.grade_id','=',self.grade_id.id) value 

res['domain']=

{'grade_ids':[('cadre_id', '=',self.cadre_id.id)], 

 'employee_ids':[('shift_line_ids.cadre_id','=',self.cadre_id.id),('shift_line_ids.grade_id','=',self.grade_id.id)]}

how i can ? any help/tips 

Avatar
Kassér
Bedste svar

Hi,

You can try like this,

res['domain']['employee_ids'].append(('shift_line_ids.grade_id','=',self.grade_id.id))

Refer : Append data to a list within a dict

Thanks

Avatar
Kassér
Forfatter

perfect working .... thanks Niyas

Bedste svar

First you need to append domains in employee_ids and then you can update dict.

eg:

employee_ids.append(values)
res['domain'] = {'employee_ids': employee_ids}
Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
5
dec. 23
18594
2
nov. 21
32921
7
mar. 20
7486
1
okt. 18
9876
1
mar. 17
5270