Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
1523 Vizualizări
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.


Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns
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


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
feb. 21
7468
1
mar. 24
1785
1
feb. 23
2082
1
dec. 22
11666
6
iun. 15
7938