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

I have a form with too many sections. Some of the sections have a lot of content and are full of optional fields. I would like some of these sections to be collapsed by default so that I can let the user focus only on those fields that are important. Any leads?

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

Hi, 

You can try by giving invisible attribute based on some condition, like if some boo-lean field is ticked make it visible and if the boo-lean field is unticked you can make it invisible. 

This is the one option available, then you can try to add notebooks in the form, so that you can arrange the fields(optional) inside the pages of the notebooks. 

Thanks

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

I tried to do the first suggestion, of having it be set to a boolean. It works but looks like a gimmick. It's sad that there is no dedicated accordion widget in Odoo. This is such a common UI widget generally used on web applications.

Thank you Niyas for your help though!

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

This is an old thread but the first link on Google.

To make collapsible sections, use the Accordion from the bootstrap framework.  It's very easy to add the accordion <div> to a form.  It worked immediately for me and I could use normal Odoo buttons and lists (/tree) within the Accordion.

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

But can you add an image on the side of this accordion? I got to the accordion and now i just wanted to chose its position and place it next to an image, but I can't seem to figure it out, would you know if that is possible?

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 22
3375
0
thg 12 19
6311
4
thg 5 15
3951
0
thg 8 23
1728
5
thg 8 23
50197