Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
2175 Prikazi

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... 



Avatar
Opusti
Avtor Best Answer

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

Avatar
Opusti
Best Answer

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

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
3
jul. 25
4426
0
maj 25
929
0
jan. 23
1763
1
nov. 22
3228
0
avg. 22
1937