Skip to Content
Menu
This question has been flagged
2 Replies
1608 Rodiniai
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.


Portretas
Atmesti
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

Portretas
Atmesti
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


Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
vas. 21
7540
1
kov. 24
1845
1
vas. 23
2143
1
gruod. 22
11759
6
birž. 15
8012