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

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

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
Zrušit
Autor

perfect working .... thanks Niyas

Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
5
pro 23
18672
2
lis 21
33037
7
bře 20
7574
1
říj 18
9965
1
bře 17
5344