Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
1489 Zobrazení
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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď
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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
úno 21
7416
1
bře 24
1758
1
úno 23
2033
1
pro 22
11616
6
čvn 15
7893