Skip to Content
Menu
This question has been flagged
2 Replies
3850 Rodiniai

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

Portretas
Atmesti
Best Answer

Hi  Adriano

Try

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


Hope it helps,
Kiran K

Portretas
Atmesti
Best Answer

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.

Portretas
Atmesti

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

Related Posts Replies Rodiniai Veikla
1
kov. 15
5052
2
rugp. 24
1780
1
kov. 15
5559
1
kov. 15
8029
1
kov. 15
4957