Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
2267 Visualizações

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
Cancelar
Autor Melhor resposta

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

Avatar
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
3
jul. 25
4636
0
mai. 25
1061
0
jan. 23
1846
1
nov. 22
3328
0
ago. 22
2014