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

Hi please who can explain me

In the new api odoo 8, how can i display recordsets.

In openerp, i did                    field_name.create(cr,uid,value)

In odoo, it will be what please

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

Thanks a lot for your answer sir.

But i got this error:


File "/opt/odoo/odoo/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

TypeError: create() takes at least 4 arguments (2 given)

الصورة الرمزية
إهمال

Probably your code is not in new api. You show more code.

الكاتب

Here is my code services.create(cr,uid,value,context) #This line how it will be changed in #api8 # where services = self.pool.get('test.project.service.line')

أفضل إجابة

In new api create has not changed, except the fact it now returns a recordset  (and is without cr,uid):

https://www.odoo.com/documentation/8.0/reference/orm.html  

self.create({'name': 'New name'}) 
الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أغسطس 25
2589
1
يوليو 25
996
1
أغسطس 25
1151
0
مايو 25
1445
2
أبريل 25
3610