Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
11895 Visualizzazioni

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
Abbandona
Risposta migliore

Don't use an ID.

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

Why [[]] instead of []?

Risposta migliore
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
Abbandona
Autore

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)

Post correlati Risposte Visualizzazioni Attività
0
nov 18
2356
2
nov 18
8135
1
set 17
3542
3
ago 17
5660
0
mag 23
2183