Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
3047 Visualizações

Is it possible to filter to one2many field using a button?


I have a partner field which is one2many
 I have customer and vendors there,

I want that when I click the customers button ,

it will display the customers only and when the button is the vendors button, only the vendors.


Thanks in advance

Avatar
Cancelar

Hi Deb Joy,

your res.partner is a One2many or Many2one?

Autor

it's Many2one

Melhor resposta

Hi Deb Joy,

For this you should create 2 O2m fields of the partner with domain (customer = True and supplier = True) and also create 2 boolean fields (show_vendor, show_customer) which will be changed from the button click.

Now, add attrs on both the O2m fields. If you click on Vendor button, the show_vendor boolean should be checkd and show_customer should be set to False and based on attrs you vendor O2m field will be visible. Same goes for Customer button.


Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
1
jun. 22
13377
1
jul. 15
4653
1
jan. 24
1900
1
ago. 23
23470
1
abr. 22
1841