Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
1924 Vues

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
Ignorer
Auteur Meilleure réponse

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

Avatar
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
3
juil. 25
3828
0
mai 25
713
0
janv. 23
1574
1
nov. 22
2970
0
août 22
1754