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

* fix: employee status server-side validation

* fix: test

* test: employee inactive status

* fix: test
This commit is contained in:
Rucha Mahabal
2021-07-30 10:21:42 +05:30
committed by GitHub
parent 383c49cfed
commit 821db5cce7
27 changed files with 88 additions and 32 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()