تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
11920 أدوات العرض

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
نوفمبر 18
2368
2
نوفمبر 18
8140
1
سبتمبر 17
3547
3
أغسطس 17
5682
0
مايو 23
2199