Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3901 Lượt xem

Hello 

I want to get the current user using the Odoo studio. Is there a way I can do it please?

Thank you in advance!

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,
First you have to create a many2one field with related model as Users(res.users).
After creating the field a compute function can given to the field in order to compute the current user. For that you can click on the ‘More’ button at the left bottom corner and will be redirected to the field properties. There under the ‘Advanced Properties’ section we can give the required dependencies and the compute function in python code as:

for record in self:
record ['x_studio_many2one_field'] = record.env.user

Now the field will compute the current user as its value.

Hope it helps

Ảnh đại diện
Huỷ bỏ

What are the required Dependencies?

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 25
1149
2
thg 3 25
1416
0
thg 2 25
1094
0
thg 2 25
1233
0
thg 2 25
1202