Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
1494 Tampilan
user_id = fields.Many2one('hr.employee', string='Employee', default=lambda self: self.env.user, tracking=True)

i did not delet any record and its working on local but when i create create record on testing instance it give me above error.


Avatar
Buang
Jawaban Terbai

Hello your field definition model is hr.employee while you have default=lambda self: self.env.user, i think this is not true at all

Avatar
Buang
Jawaban Terbai
user_id = fields.Many2one('res.users', string='Employee', default=lambda self: self.env.user, tracking=True)

change model 'hr.employee' to 'res.users'., it will be work. 

Thanks


Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
2
Feb 21
7429
1
Mar 24
1761
1
Feb 23
2036
1
Des 22
11631
6
Jun 15
7900