hello all i'am workig on leaves conditions module in version 10 , i added a validation that rais when no joining date asigneed to the employee , it;s working well,
here is the code
@api.constrains('state', 'date_from', 'holiday_status_id',)
def _check_hire_date(self):
if self.employee_id.joining_date:
jo_dt = fields.Datetime.from_string(self.employee_id.joining_date)
else:
raise ValidationError("you must define joining date")