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

Hi everyone,

I’ve added a custom field to the Odoo CRM module, which is a selection field with two options: Active and Inactive. Now, I want to add a single button at the top of the List View that will allow me to toggle between showing Active and Inactive leads.

Here are my requirements:

  • I don’t want to use the default custom filters.
  • I just want a single button that, when clicked, will toggle the displayed leads (Active ↔ Inactive) dynamically.

Has anyone done something similar or have ideas on how to achieve this?


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

I think the easiest way would be to create 2 buttons: switch_to_active and switch_to_inactive.

Bind each button to the existing action to open the view, but with an added context entry to set the filters or to use as a condition for filtering.

Hide one button or the other based on that context entry so only one is visible at all time.


Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you! can this be done in studio?

You'll need to edit some XML to be able to pass new context.
See this question/answer: https://www.odoo.com/forum/help-1/how-to-pass-values-in-lead-to-sales-through-action-button-118177

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 24
2875
0
thg 1 21
2157
1
thg 9 16
5295
1
thg 6 24
1276
1
thg 3 21
2968