Skip to Content
Menu
This question has been flagged
2 Replies
1851 Views

Hello Community ,  i have a question about the diffrence between create() & create().id 

i have a code with create().id when i delete .id there is a problem ?

self.env['model.class'].create()

 self.env['model.class'].create().id

thanks 

Avatar
Discard
Best Answer

self.env['model.class'].create() => return record set like res.partner(78)

self.env['model.class'].create().id => return id (that is 78)

Avatar
Discard
Best Answer


From odoo8/9: create return object ,
For getting it id we use create().id
Avatar
Discard