Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
1607 Prikazi
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
Opusti
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
Opusti
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
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
feb. 21
7540
1
mar. 24
1844
1
feb. 23
2142
1
dec. 22
11759
6
jun. 15
8011