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

How to create and write multiple records by overriding create and write method of odoo12 ??

الصورة الرمزية
إهمال
أفضل إجابة

Create method uses api.model and due to that you can only create one record at a time.

Write method uses api.multi and due that you can update multiple records at a time.

الصورة الرمزية
إهمال
الكاتب

while i am using @api.multi and trying to write multiple record at a time ,then it trows singleton error and suggest to use ensure_one().

الكاتب

You are right for the above answer but somehow i want to write multiple records at a time.So please suggest

You can create a wizard for that and based on some conditions search your records and write the value to them.

الكاتب

Is there any suggestions for this type of solutions please sir ..and thank you very much

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
يناير 16
35030
2
أغسطس 19
4315
0
سبتمبر 20
37
1
أغسطس 20
4163
1
أبريل 20
4734