跳至內容
選單
此問題已被標幟
1 回覆
3081 瀏覽次數

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

頭像
捨棄

Hi Deb Joy,

your res.partner is a One2many or Many2one?

作者

it's Many2one

最佳答案

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.


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
6月 22
13397
1
7月 15
4663
1
1月 24
1916
1
8月 23
23498
1
4月 22
1854