تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
1577 أدوات العرض
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
فبراير 21
7523
1
مارس 24
1824
1
فبراير 23
2124
1
ديسمبر 22
11735
6
يونيو 15
7983