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

Hello,

I'm trying to get already value from job_title field of hr.employee model like:

abc = fields.Many2one('hr.employee.job_title', 'Job Title')


But I got the error message when clicking on the field in form view although I used administrator user to access it:

Something went wrong !


Sorry, you are not allowed to access documents of type 'Unknown' (_unknown). No group currently allows this operation. - (Operation: read, User: 2)


What am I doing wrong? 

Please help!

Thank you!


Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you Niyas!

Câu trả lời hay nhất

Hi ,

abc = fields.Char( 
related='employee_id.job_title',
string='Job Title',store=True
)

Job Title in hr.employee is a character field and  use related to get data from employee_id

Ảnh đại diện
Huỷ bỏ
Tác giả

Yes, I got it. Thank you Kiran !

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 12 22
3018
0
thg 8 21
3402
1
thg 2 21
2679
1
thg 8 17
4304
1
thg 2 17
5306