Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
1578 Vues
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
Ignorer
Meilleure réponse

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
Ignorer
Meilleure réponse
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
Ignorer
Publications associées Réponses Vues Activité
2
févr. 21
7523
1
mars 24
1824
1
févr. 23
2124
1
déc. 22
11735
6
juin 15
7983