问题
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