Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
12125 Ansichten

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
Verwerfen
Beste Antwort

Don't use an ID.

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

Why [[]] instead of []?

Beste Antwort
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
Verwerfen
Autor

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)

Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Nov. 18
2481
2
Nov. 18
8381
1
Sept. 17
3706
3
Aug. 17
5849
0
Mai 23
2372