コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
3823 ビュー

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
5020
2
8月 24
1769
1
3月 15
5544
1
3月 15
8016
1
3月 15
4931