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

Hello,

How can I update a recordset?. The below code does not work.

employee = self.env['hr.employee'].search([('id', '=', holiday.employee_id.id)], limit=1)

employee.write({'identification_id': '3435323423'})


頭像
捨棄

if it is not working then try this,

employee.identification_id = 3435323423

最佳答案

Hi

Your format is correct If your identification_id field is a string

If it is a many2one or integer field then you should remove the quotes.

ie, employee.write({'identification_id': 3435323423})
You can also write like Niyas Raphy said.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
5月 24
6509
1
1月 20
6185
1
1月 16
3615
0
9月 15
4084
0
8月 15
4593