How to disable days in Odoo Datepicker before a date?

爱⌒轻易说出口 提交于 2020-05-16 22:01:18

问题


I have a model in odoo with a fields.Date attribute (expiration_date) How can I disable all days in its odoo datepicker before a date (like january 2016), so all those days before january 2016 would not be accesible in odoo datepicker?


回答1:


You need to specify the minDate option of the date picker widget.

To disable dates before January 2016 we can pass the date as a string:

<field name="date_invoice" 
       options="{'datepicker': {'warn_future': true, 'minDate': '2016-01-01'}}"/>


来源:https://stackoverflow.com/questions/61513449/how-to-disable-days-in-odoo-datepicker-before-a-date

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!