if record.holiday_type_id.code == 'L001' and record.employee_id.social_work_start_date:
if (datetime.datetime.strptime(submit_date,'%Y-%m-%d') - datetime.datetime.strptime(record.employee_id.social_work_start_date,'%Y-%m-%d')).days+1 <= 365:
raise ValidationError('社会工龄不足1年,不允许使用年假'):
if record.holiday_type_id.code == 'L001' and record.employee_id.social_work_start_date:
if (datetime.datetime.strptime(submit_date,'%Y-%m-%d') - datetime.datetime.strptime(record.employee_id.social_work_start_date,'%Y-%m-%d')).days+1 <= 365:
raise ValidationError('社会工龄不足1年,不允许使用年假'):