Skip to Content
Menu
This question has been flagged
2 Replies
2411 Rodiniai

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



Portretas
Atmesti
Autorius Best Answer

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

Portretas
Atmesti
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

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
3
liep. 25
4860
0
geg. 25
1199
0
saus. 23
1954
1
lapkr. 22
3429
0
rugp. 22
2093