Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
2264 Visualizzazioni

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
Abbandona
Autore Risposta migliore

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

Avatar
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
lug 25
4636
0
mag 25
1058
0
gen 23
1842
1
nov 22
3323
0
ago 22
2010