fix: employee status server-side validation (#26615)

This commit is contained in:
Rucha Mahabal
2021-07-24 00:08:02 +05:30
committed by GitHub
parent 9052a3b1a8
commit 017ed3f5c1
27 changed files with 91 additions and 34 deletions

View File

@@ -15,12 +15,15 @@ from erpnext.manufacturing.doctype.workstation.workstation import (check_if_with
WorkstationHolidayError)
from erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings import get_mins_between_operations
from erpnext.setup.utils import get_exchange_rate
from erpnext.hr.utils import validate_active_employee
class OverlapError(frappe.ValidationError): pass
class OverWorkLoggedError(frappe.ValidationError): pass
class Timesheet(Document):
def validate(self):
if self.employee:
validate_active_employee(self.employee)
self.set_employee_name()
self.set_status()
self.validate_dates()