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

As per Odoo 10 official documentation, the way to delete data from a model using XMLRPC is:

models.execute_kw(db, uid, password, 'res.partner', 'unlink', [[id]])

If I want to delete all res.partner records, what shall I use as 'id'?

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

Don't use an ID.

models.execute_kw(db, uid, password, 'res.partner', 'unlink', [[]])
Ảnh đại diện
Huỷ bỏ
Tác giả

Why [[]] instead of []?

Câu trả lời hay nhất
search_ids = models.execute_kw(db, uid, password, 'res.partner', 'search', [])
models.execute_kw(db, uid, password, 'res.partner', 'unlink', search_ids)

Hope this will help you.

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

Ray's answer is faster to solve the specific issue, but using a search points how to select a given set of IDs (which might be really useful)

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 18
2368
2
thg 11 18
8140
1
thg 9 17
3547
3
thg 8 17
5680
0
thg 5 23
2197