I have a view with a date field. The user must not select a date after today. How can I disable all days after the current date in Odoo datepi
.cker?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Give
options="{'datepicker':{'maxDate': 'now'}}"
Hello,
You refer below link.
https://stackoverflow.com/questions/61673978/how-to-disable-days-after-current-date-in-odoo-datepicker
Hi Ernesto:
The syntax seems to be as follows:
<field name="...." options="{'datepicker': {'maxDate': '<date in local format>'}}"/>
You can also pass in a 'minDate' if you want to restrict the values in the field to a date range.
For example,
<field name="validity_date" options="{'datepicker': {'maxDate': '5/8/2020'}}"/>However, there does not seem to be a way to pass the current date ('5/8/2020' in this example) as a variable. Hoping someone else can throw some light on how to pass the current date in place of the string '5/8/2020'. Using current_date does not seem to work within options.
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký