Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
2579 Lượt xem

Hi, via api I'm trying to assign employee_ids = [2898] to the res.partner with id = 2719. I'm not getting any errors but the value isn't being assigned. How come?

models.execute_kw(db, uid, password, 'res.partner', 'write', [[2719], {'employee_ids': [(4, 2898)]}])

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Unfortunately, if hr_employee_id is not entered in employee_ids, in the res.partner view the smart button with the associated employees is not displayed

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You can do it in opposite way, you can update address_home_id field in hr.employee to the partner (the partner type should be private)

models.execute_kw(db, uid, password, 'hr.employee', 'write', [[2898], {'address_home_id ': 2719 }])

Ảnh đại diện
Huỷ bỏ
Tác giả

Unfortunately, if hr_employee_id is not entered in employee_ids, in the res.partner view the smart button with the associated employees is not displayed

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 3 24
3432
1
thg 11 23
1521
1
thg 5 25
2212
1
thg 4 25
3256
1
thg 4 25
4078