Skip to Content
मेन्यू
This question has been flagged
2 Replies
11885 Views

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'?

Avatar
Discard
Best Answer

Don't use an ID.

models.execute_kw(db, uid, password, 'res.partner', 'unlink', [[]])
Avatar
Discard
Author

Why [[]] instead of []?

Best Answer
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.

Avatar
Discard
Author

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)

Related Posts Replies Views Activity
0
नव॰ 18
2354
2
नव॰ 18
8132
1
सित॰ 17
3541
3
अग॰ 17
5660
0
मई 23
2178