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

Hello,


I'm starting at Odoo development, so I challenged myself to create a CV application. This application has a Resumé model and a Appliant model. An appliant can create as many Resumés as he/she needs.

I have both menu entries, "Resumés" and "Appliants".

When I enter the Resumé tree view, the columns for the title of the resumé and the appliant's name are displayed.

On each appliant's entry, there is a One2Many tree displaying the resumés the appliant has submitted. Obviously, displaying the appliant's name column in this table is redundant, so I would like to hide the column only when the table is shown in the appliant's form view. The column should still be displayed in the Resumé tree view.

I have googled for the solution, and found information about making a column invisible via the attrs:



With this approach, I don't know how to customize the conditions to fit my goal.

Also, I found out about extending views. But I think the above mentioned method is a simpler approach.

Am I right? What conditions should I set to make the column_invisible only when the tree view is displayed inside the Applicant form?

Thank you in advance.

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

Hi,

You can pass/set some markers via context of the menu action and then based on it, you can hide the tree.

See this sample: https://www.youtube.com/watch?v=Lkhnvh6dhhA

Thanks

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

Thank you! It worked great

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 8 21
6633
2
thg 2 18
5902
1
thg 10 15
3435
0
thg 2 23
3754
1
thg 2 23
3157