Ejemplo n.º 1
0
	def test_validate_timings(self):
		check_if_within_operating_hours("_Test Workstation 1", "Operation 1", "2013-02-02 11:00:00", "2013-02-02 19:00:00")
		check_if_within_operating_hours("_Test Workstation 1", "Operation 1", "2013-02-02 10:00:00", "2013-02-02 20:00:00")
		self.assertRaises(NotInWorkingHoursError, check_if_within_operating_hours,
			"_Test Workstation 1", "Operation 1", "2013-02-02 05:00:00", "2013-02-02 20:00:00")
		self.assertRaises(NotInWorkingHoursError, check_if_within_operating_hours,
			"_Test Workstation 1", "Operation 1", "2013-02-02 05:00:00", "2013-02-02 20:00:00")
		self.assertRaises(WorkstationHolidayError, check_if_within_operating_hours,
			"_Test Workstation 1", "Operation 1", "2013-02-01 10:00:00", "2013-02-02 20:00:00")
Ejemplo n.º 2
0
	def check_workstation_timings(self, args):
		"""Checks if **Time Log** is between operating hours of the **Workstation**."""
		if args.workstation and args.from_time and args.to_time:
			check_if_within_operating_hours(args.workstation, args.operation, args.from_time, args.to_time)
Ejemplo n.º 3
0
    def check_workstation_timings(self):
        """Checks if **Time Log** is between operating hours of the **Workstation**."""
        if self.workstation and self.from_time and self.to_time:
            from erpnext.manufacturing.doctype.workstation.workstation import check_if_within_operating_hours

            check_if_within_operating_hours(self.workstation, self.operation, self.from_time, self.to_time)
Ejemplo n.º 4
0
	def check_operation_fits_in_working_hours(self, d):
		"""Raises expection if operation is longer than working hours in the given workstation."""
		from erpnext.manufacturing.doctype.workstation.workstation import check_if_within_operating_hours
		check_if_within_operating_hours(d.workstation, d.operation, d.planned_start_time, d.planned_end_time)
Ejemplo n.º 5
0
 def check_workstation_timings(self, args):
     """Checks if **Time Log** is between operating hours of the **Workstation**."""
     if args.workstation and args.from_time and args.to_time:
         check_if_within_operating_hours(args.workstation, args.operation,
                                         args.from_time, args.to_time)