콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4 답글
17238 화면

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.

아바타
취소
베스트 답변

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..

아바타
취소

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.

베스트 답변

print self.ids

or

print self._ids

아바타
취소
베스트 답변

Hi Jainesh Shah,

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

Thank you.

아바타
취소
베스트 답변

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

아바타
취소
관련 게시물 답글 화면 활동
0
9월 23
41
2
7월 22
4075
0
5월 22
2383
1
11월 21
18785
2
10월 21
7913