Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
4 Risposte
16948 Visualizzazioni

Hi Community,

 I use self.id inside of onchange that is returning me " <openerp.models.Newid object at 0xb0efbc4c>".

- I want to get record's id.

Any idea?

Thanks in advance.

Avatar
Abbandona
Risposta migliore

If your record is already created in Odoo, 

Then on onchange method you can access it using self._origin.

If record is not created, then there is no way to access it uptil record is not saved.


hope this helps..

Avatar
Abbandona

Just what I was looking for, thanks Asmita!

Is this work in compute function

I am not sure about this, but it won't work on compute field function, as in compute field function we can directly access record's id, once it is saved.

Risposta migliore

print self.ids

or

print self._ids

Avatar
Abbandona
Risposta migliore

Hi Jainesh Shah,

You can only get the record's id after saving your details.

Thank you.

Avatar
Abbandona
Risposta migliore

Hi Jainesh,

yes it's possible,

example =

self.browse (cr, uid, ids [0])


https://www.odoo.com/fr_FR/forum/aide-1/question/is-it-possible-to-capture-both-original-and-new-values-in-an-on-change-method-44119

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
set 23
41
2
lug 22
3794
0
mag 22
2081
1
nov 21
18477
2
ott 21
7507