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

I have an @api.one method and need the id of the current record. Like the other magic field as create_date aso., I can get this fields into a view but I didn'd find a solution to get them into @api.one method. If I try "print  self.create_date"  the result is false.


아바타
취소

self.id didn't work?

작성자

No self.id gets the following result: "openerp.models.NewId object at 0x7f36a85bd250" But actually I don't work in new record.

Simply use the ids value defined in method defination def method_name(self, cr, uid, ids, ,context=None)

작성자

Sorry Shivam, I don't understand your comment. I'm not so used in the old API. Do I have to create a method to get the ID?

베스트 답변

This question is pretty old but for anyone who wandered looking for an answer, 
Try:  "self._origin.id"

아바타
취소
관련 게시물 답글 화면 활동
1
6월 19
5755
0
9월 19
98
1
7월 17
4684
4
8월 16
8902
1
5월 16
5443