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

I have a field "Operator"

I need to automatically populate it with the name of the user logged in

How do I do that ?

Thanks

아바타
취소
베스트 답변

Hi  Adriano

Try

operator_id = fields.Many2one('res.users', 'Operator', default=lambda self: self.env.user, readonly=True)


Hope it helps,
Kiran K

아바타
취소
베스트 답변

Hi,

you can find every table contains the following 4 fields:

create_uid,create_date,write_uid,write_date

you can display them just one line code easily in your XML file:





Hope it is useful.

Thanks.

아바타
취소

<field name="write_uid" string="UpdatedBy"/>
<field name="write_date" string="UpdatedDate"/>
<field name="create_uid" string="CreatedBy" />
<field name="create_date" string="CreatedDate"/>

관련 게시물 답글 화면 활동
1
3월 15
5260
2
8월 24
2010
1
3월 15
5767
1
3월 15
8248
1
3월 15
5103