콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4898 화면

I would like to know how to automatically display records in a list due based on the due date date being the current day.

 

for example I would like to be able to be shown only delivery orders (grouped by status) on the current day when accessing the delivery order list view.

 

how can i set a default filter to do this?

Thanks

아바타
취소
베스트 답변

John,

You should have a date field which stores the date. On the action, you should write the domain,

Use a domain like this :

domain = [('date', '=', context_today())]

domain = [('date','=',datetime.strftime('%%Y-%%m-%%d') )]"

domain = [('date','=',time.strftime('%%Y-%%m-%%d'))]

You may create a default filter in search view:

<filter icon="terp-go-today" string="Today" domain="[('date','&lt;=',time.strftime('%%Y-%%m-%%d 23:59:59')),('date','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Today"/>

This should help.

Thanks.

아바타
취소