Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3067 Lượt xem

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

Ảnh đại diện
Huỷ bỏ

Hi Deb Joy,

your res.partner is a One2many or Many2one?

Tác giả

it's Many2one

Câu trả lời hay nhất

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.


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 22
13383
1
thg 7 15
4655
1
thg 1 24
1910
1
thg 8 23
23487
1
thg 4 22
1850