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

I want to to apply a logic on the list view 

There is a field x_doe (expiry date) for, If the Current date (system date) is 1 week due the date of expiry, the color of the view should become red...

can you please tell me how to apply that?

아바타
취소
베스트 답변

Hi Suhaib,

You can simply define a computed field and then utilize that in decoration danger in list view.



아바타
취소
베스트 답변

Hi,

As far as I know you won't be able to change the color of the date field itself in odoo 11, but you can make the record/line red in the listview by adding the following to the tree view tag in the list view 

decoration-danger="x_doe >= (context_today() + relativedelta(days=-7)).strftime('%Y-%m-%d')"

Example below is what I tested on Odoo demo site for sales orders.

<tree string="Quotation" class="o_sale_order" multi_edit="1" sample="1" decoration-danger="create_date >= (context_today() + relativedelta(days=-7)).strftime('%Y-%m-%d')" >

Kind Regards,

아바타
취소
베스트 답변

you can take reference from the manufacturing orders tree view

아바타
취소
관련 게시물 답글 화면 활동
2
5월 21
19075
1
6월 18
9062
0
12월 23
1369
1
5월 23
2882
1
9월 22
8281