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

Good day everyone, 

I have an issue when using the date widget on Odoo 16, I need to config maxDate for the date field. However, I get an error: "OwlError: Invalid props for component 'DatePicker': 'maxDate' is not a datetime". I looked at the code of the date widget, the problem is that the widget is validating prop maxDate with a type datetime js object, I don't know how to pass a value with a type datetime object from an XML file, it seems crazy. This is my config field:

field name="date_field" widget="date" options="{'datepicker': {'maxDate': '2024-07-10'}}"

The issue only occurs when the developer mode is active

아바타
취소
베스트 답변

Well if you are using odoo 17 then maxDate is string but in odoo 16 seem no way at all
So in your case you can either you python constraint or sql constraint to validate max date

아바타
취소
관련 게시물 답글 화면 활동
1
7월 23
4652
0
3월 24
3392
1
9월 22
6321
1
3월 22
6189
0
5월 21
4069