跳至内容
菜单
此问题已终结
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.


形象
丢弃
最佳答案

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

形象
丢弃
最佳答案
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


形象
丢弃
相关帖文 回复 查看 活动
2
2月 21
7478
1
3月 24
1792
1
2月 23
2091
1
12月 22
11673
6
6月 15
7944