Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
11592 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

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


Awatar
Odrzuć
Najlepsza odpowiedź

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


Awatar
Odrzuć
Autor

Before the return?

ex:

def create(self, vals):

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

# now i have the NewId?

return ret

Powiązane posty Odpowiedzi Widoki Czynność
2
sie 25
2657
1
lip 25
1037
1
sie 25
1151
0
maj 25
1497
2
kwi 25
3647