Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
11901 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

Don't use an ID.

models.execute_kw(db, uid, password, 'res.partner', 'unlink', [[]])
Imagine profil
Abandonează
Autor

Why [[]] instead of []?

Cel mai bun răspuns
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.

Imagine profil
Abandonează
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)

Related Posts Răspunsuri Vizualizări Activitate
0
nov. 18
2361
2
nov. 18
8137
1
sept. 17
3542
3
aug. 17
5664
0
mai 23
2186