Hi everybody!!!
Please, i want to create a function which make me able to return the id of the object which i am creating.
I need your help please
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi everybody!!!
Please, i want to create a function which make me able to return the id of the object which i am creating.
I need your help please
well...
first.. that would be method, (since it belongs to a certain class )
second... the openerp/odoo framework in fact has such method...
just call create(self, ... values) ... pass the required/optional values as a dictionary,
and it will return the id of new created record...
hope it helps : )
edit after comment:
partner_obj = self.pool.get('res.partner')
in v7 api:
created_partner_id = partner_obj.create(cr, uid, {'name':'Example partner'}).
n v8 api:created_partner_id = partner_obj.create({'name':'Example Partner'}).
you should also look in developers documentation:
for v8: https://www.odoo.com/documentation/8.0/reference/orm.html
r for v7 look for : OpenERP technical memento ... .hope it helps now : )
thx for the answer but can you please give me an example
edited my initial answer
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 12 22
|
14919 | ||
|
1
thg 11 21
|
5045 | ||
|
0
thg 1 21
|
2341 | ||
|
8
thg 5 20
|
7932 | ||
|
0
thg 12 23
|
2984 |