如何在日期之前禁用Odoo Datepicker中的日期? [英] How to disable days in Odoo Datepicker before a date?

查看:331
本文介绍了如何在日期之前禁用Odoo Datepicker中的日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在odoo中有一个带有fields.Date属性的模型.date属性(expiration_date)如何在日期之前(如2016年1月)禁用其odoo datepicker中的所有日期,因此2016年1月之前的所有日期都不能在odoo中使用日期选择器?

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?

推荐答案

您需要指定日期选择器小部件的minDate选项.

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

要禁用January 2016之前的日期,我们可以将日期作为字符串传递:

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'}}"/>

这篇关于如何在日期之前禁用Odoo Datepicker中的日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆