コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
11886 ビュー

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

アバター
破棄
最善の回答

Don't use an ID.

models.execute_kw(db, uid, password, 'res.partner', 'unlink', [[]])
アバター
破棄
著作者

Why [[]] instead of []?

最善の回答
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.

アバター
破棄
著作者

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)

関連投稿 返信 ビュー 活動
0
11月 18
2354
2
11月 18
8133
1
9月 17
3541
3
8月 17
5660
0
5月 23
2181