Пример #1
0
 def validate(self):
     validate_dates(self, self.from_date, self.to_date)
     if self.half_day:
         if not getdate(self.from_date) <= getdate(
                 self.half_day_date) <= getdate(self.to_date):
             frappe.throw(
                 _("Half day date should be in between from date and to date"
                   ))
Пример #2
0
 def validate(self):
     validate_dates(self, self.work_from_date, self.work_end_date)
     if self.half_day:
         if not self.half_day_date:
             frappe.throw(_("Half Day Date is mandatory"))
         if not getdate(self.work_from_date) <= getdate(
                 self.half_day_date) <= getdate(self.work_end_date):
             frappe.throw(
                 _("Half Day Date should be in between Work From Date and Work End Date"
                   ))
     validate_overlap(self, self.work_from_date, self.work_end_date)
     self.validate_holidays()
     self.validate_attendance()
     if not self.leave_type:
         frappe.throw(_("Leave Type is madatory"))