Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2169 Представления

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
июл. 23
4576
0
мар. 24
3357
1
сент. 22
6288
1
мар. 22
6127
0
мая 21
4051