Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
11944 Zobrazení

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
Zrušit
Nejlepší odpověď

Don't use an ID.

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

Why [[]] instead of []?

Nejlepší odpověď
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
Zrušit
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 Odpovědi Zobrazení Aktivita
0
lis 18
2382
2
lis 18
8148
1
zář 17
3559
3
srp 17
5702
0
kvě 23
2214