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
1277 Widoki

the xml code:


tree,form 

[('partner_id', '=', 'self.env.user.partner_id')] 


the model field:

partner_id = fields.Many2one("res.partner",default= lambda self: self.env.user.partner_id, readonly=True)


but if the page is opened it shows nothing, even if there are objects that have the partner id... 



Awatar
Odrzuć
Autor Najlepsza odpowiedź

Thanks for the answer but it still doesnt work...

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

Please replace your domain as below, and try it.


partner_id = fields.Many2one("res.partner",default= lambda self: self.env.user.partner_id.id, readonly=True)


added  .id after the partner_id


Hope it helps

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
maj 25
54
2
mar 25
2463
0
sty 23
1168
1
lis 22
2501
0
sie 22
1440