Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
1241 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à
2
mar 25
2398
0
gen 23
1152
1
nov 22
2480
0
ago 22
1418
1
lug 22
3391