Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
1627 มุมมอง
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


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.พ. 21
7556
1
มี.ค. 24
1856
How can I recover ownership? แก้ไขแล้ว
1
ก.พ. 23
2150
Odoo database failed แก้ไขแล้ว
1
ธ.ค. 22
11786
Edit Company data Powered by Odoo แก้ไขแล้ว
6
มิ.ย. 15
8022