콘텐츠로 건너뛰기
메뉴
신고된 질문입니다
2 답글
1772 화면

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.

아바타
취소

This didn't work on v17. Any ideas?

베스트 답변

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

아바타
취소
작성자

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

베스트 답변

This didn't work on v17. Any ideas?

아바타
취소

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.