Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
1496 Widoki
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.


Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź
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


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lut 21
7438
1
mar 24
1764
1
lut 23
2044
1
gru 22
11637
6
cze 15
7910