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

I recently read some code that called with the isinstance method which checked the record id on NewId. I don't find documentation on NewId, can you explain to me what it refers to?

Avatar
Discard
Best Answer

When creating a record , the records of the recordset will be in memory only. At that time the id of the record will be a dummy ids of type NewId .

https://www.odoo.com/fr_FR/forum/aide-1/what-kind-of-error-is-this-184634#answer-184639


Avatar
Discard
Best Answer

NewId is propose (virtual ) location of record which has not been saved in Database .
in another word NewId will get memory location in  create moment


Avatar
Discard
Author

Before the return?

ex:

def create(self, vals):

ret = super(Model, self).create(vals)

# now i have the NewId?

return ret

Related Posts Replies Views Activity
0
May 25
132
2
Apr 25
2399
1
Feb 25
746
2
Feb 25
1262
2
Jan 25
1370