From 3aa1101d5ef86c1a0070af3d7cf8a465ff6b005a Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Tue, 28 Jul 2020 13:32:13 +0530 Subject: [PATCH] fix: requested changes --- erpnext/hr/doctype/department_approver/department_approver.py | 2 +- erpnext/hr/doctype/shift_assignment/shift_assignment.py | 4 ++-- erpnext/hr/doctype/shift_type/shift_type.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/hr/doctype/department_approver/department_approver.py b/erpnext/hr/doctype/department_approver/department_approver.py index b5aa4ac6d4..e65c9f8eba 100644 --- a/erpnext/hr/doctype/department_approver/department_approver.py +++ b/erpnext/hr/doctype/department_approver/department_approver.py @@ -46,7 +46,7 @@ def get_approvers(doctype, txt, searchfield, start, page_len, filters): elif filters.get("doctype") == "Leave Application": parentfield = "expense_approvers" field_name = "Expense Approver" - else: + elif filters.get("doctype") == "Shift Request": parentfield = "shift_request_approver" field_name = "Approver" if department_list: diff --git a/erpnext/hr/doctype/shift_assignment/shift_assignment.py b/erpnext/hr/doctype/shift_assignment/shift_assignment.py index c81345da78..f25d39b78f 100644 --- a/erpnext/hr/doctype/shift_assignment/shift_assignment.py +++ b/erpnext/hr/doctype/shift_assignment/shift_assignment.py @@ -16,7 +16,7 @@ class ShiftAssignment(Document): self.validate_overlapping_dates() if self.end_date and self.end_date <= self.start_date: - frappe.throw(_("End Date should not be less than Start Date")) + frappe.throw(_("End Date must not be greater than Start Date")) def validate_overlapping_dates(self): if not self.name: @@ -62,7 +62,7 @@ class ShiftAssignment(Document): if shift_details.docstatus == 0: msg = _("Employee {0} has already applied for {1}: {2}").format(self.employee, self.shift_type, shift_details.name) if shift_details.docstatus == 1 and shift_details.status == "Active": - msg = _("Employee {0} already have Active Shift {1}: {2}").format(self.employee, self.shift_type, shift_details.name) + msg = _("Employee {0} already has Active Shift {1}: {2}").format(self.employee, self.shift_type, shift_details.name) if shift_details.start_date: msg += _(" from {0}").format(getdate(self.start_date).strftime("%d-%m-%Y")) if shift_details.end_date: diff --git a/erpnext/hr/doctype/shift_type/shift_type.py b/erpnext/hr/doctype/shift_type/shift_type.py index 19735648aa..dfe094e6b7 100644 --- a/erpnext/hr/doctype/shift_type/shift_type.py +++ b/erpnext/hr/doctype/shift_type/shift_type.py @@ -79,7 +79,7 @@ class ShiftType(Document): mark_attendance(employee, date, 'Absent', self.name) def get_assigned_employee(self, from_date=None, consider_default_shift=False): - filters = {'date':('>=', from_date), 'shift_type': self.name, 'docstatus': '1'} + filters = {'start_date':('>=', from_date), 'shift_type': self.name, 'docstatus': '1'} if not from_date: del filters['date'] assigned_employees = frappe.get_all('Shift Assignment', 'employee', filters, as_list=True)