跳至內容
選單
此問題已被標幟
5632 瀏覽次數

In openerp 7 how to validate time field (float data type) to accepts the format only xx:yy if user enter any other format for example 100:00 it not accepts.

In python validation for time fields available. Is there any sample code available to check time (float data type) to accept the format only xx:yy?

    def _my_check_method(self, cr, uid, ids, context=None):
          #Your code goes here
    return True or False

_constraints = [(_my_check_method, 'Your Message', ['your_field']),]

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
7月 25
4455
6
9月 19
11821
2
3月 16
8180
1
1月 24
12990
0
3月 15
8499