0
這是參考我關於Client side validation in openerp客戶端驗證的OpenERP
我需要進一步澄清,並請善待足以幫助我這個問題。
我需要知道的是,即使我檢查了值並在結果爲false時得到錯誤消息;一旦錯誤消息關閉,我仍然可以保存錯誤的類型值。
請幫我避免,直到你輸入正確的值,你不能繼續。
檢查領域將是,
'start_time': fields.char('Start Time'),
和功能將是
def check_start_time(self,cr,uid,ids,start_time_check,context=None):
starting_time=start_time_check
try:
time.strptime(starting_time, "%H:%M")
return True
except ValueError:
raise osv.except_osv(('Error'), ('Start time not in hh:mm format (Eg: 08:30)'))
可以調用'check_start_time'功能更多的時間在'write'或'然後create'方法不能保存,直到正確的值被輸入。 – SDBot
類中已經有一個創建方法,我可以再次調用另一個創建方法嗎?非常感謝你提供快速支持btw ... –
你不能只編輯現有的'create'方法嗎? – SDBot