跳至內容
選單
此問題已被標幟
2 回覆
4617 瀏覽次數

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 

頭像
捨棄
最佳答案

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

頭像
捨棄
作者

perfect working .... thanks Niyas

最佳答案

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}
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
5
12月 23
18705
2
11月 21
33069
7
3月 20
7620
1
10月 18
9992
1
3月 17
5378