fix: allow creating Shift Assignment for same day (#28613) (#28630)

(cherry picked from commit 4458b24813)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
This commit is contained in:
mergify[bot]
2021-11-30 14:42:36 +05:30
committed by GitHub
parent 3d76afbc7b
commit 6c5cefb3ac

View File

@@ -19,8 +19,8 @@ class ShiftAssignment(Document):
validate_active_employee(self.employee)
self.validate_overlapping_dates()
if self.end_date and self.end_date <= self.start_date:
frappe.throw(_("End Date must not be lesser than Start Date"))
if self.end_date:
self.validate_from_to_dates('start_date', 'end_date')
def validate_overlapping_dates(self):
if not self.name: