Link: http://stackoverflow.com/questions/32688253/python-constraints-error-message
I have written a function like below in Python. works like if user selects holiday start-date and holiday end-date with time correctly it will accepts, else it will show an error message like 'Error: Entered Invalid Date or Time'
Python code:
def _date_start_end_validate(self, cr, uid, ids, context=None):
sr_ids = self.search(cr, 1 ,[], context=context)
for self_obj in self.browse(cr, uid, ids, context=context):
if self_obj.date_start >= self_obj.date_end:
return False
return True
_constraints = [(_date_start_end_validate, 'Error: Entered Invalid Date or Time', ['Dates'])]
I need to display which start-date is showing error here, that date should to displayed.
How to get that start-date information in constraints.