Skip to Content
मेन्यू
This question has been flagged
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
Discard
Best Answer

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
Discard
Best Answer
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
Discard
Related Posts Replies Views Activity
2
फ़र॰ 21
7443
1
मार्च 24
1768
1
फ़र॰ 23
2053
1
दिस॰ 22
11646
6
जून 15
7915