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

Hi dear Odooers.

How can I set a default view to be used when opening the "all timesheets" screen in the Timesheet module ?

The goal is to present by default the monhtly view instead of the weekly view.

I tried saving the preferred view but it doesn't work.
I assume there is a simple way I didn't see yet... ;-)

Thanks for your support,

V.

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

This didn't work on v17. Any ideas?

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

Hello Vincent, 

I searched for month to change my default "My timesheet" to monthly view, and I finally found this morning :-)

Go to Settings in developper mode --> Technique --> Actions --> Interface Actions
There you can search for "Timesheet" to filter the list.
You should see your default "My Timesheets" view, open it.
In the Filter section, adapt the context value by adding " 'grid_range': 'month' " in front of it :

{ 'grid_range': 'month', 'grid_anchor': (datetime.date.today()).strftime('%Y-%m-%d'), 'my_timesheet_display_timer': True, 'group_expand': True, "is_timesheet": 1, }

Save and get back to your Timesheets module... The magic should happen :-)

Kr,

Thibaud

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

Hi Thibaud.
Un tout grand merci !
Thanks a lot for sharing !
All the best.
Vincent.

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

This didn't work on v17. Any ideas?

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

Hello Dimitrios,
it work on my side with the following context value :
{'grid_range': 'month', 'grid_anchor': (datetime.date.today()-relativedelta(months=1)).strftime('%Y-%m-%d'), 'my_timesheet_display_timer': True, 'group_expand': True, "is_timesheet": 1,}

I get the default view in "Month" and I forced to start from the last month with "-relativedelta(months=1)"

Kr

Thibaud

Thanks Thibaud. I'm unclear on how to add the context value. I only see two fields when I click My Timesheets in Actions: Action Name and Action Type. Should I add the code to Action Type?

Never mind, I found it. Developer Mode, then click in Debug menu, Edit Action. Now I have access to the Context Value field and many others.