Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
11590 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Autor

Before the return?

ex:

def create(self, vals):

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

# now i have the NewId?

return ret

Related Posts Odpovědi Zobrazení Aktivita
2
srp 25
2656
1
čvc 25
1036
1
srp 25
1151
0
kvě 25
1495
2
dub 25
3647