'Check if there is no overlap in setting Workstation Operating Hours'

def validate_overlap_for_operation_timings(self):

    for d in self.get(u'working_hours'):
        existing = frappe.db.sql_list(u'select    idx    from    `tabWorkstation    Working    Hour`\n DCTB  DCTB  DCTB  DCTB where    parent    =    %s    and    name    !=    %s\n DCTB  DCTB  DCTB  DCTB  DCTB and    (\n DCTB  DCTB  DCTB  DCTB  DCTB  DCTB (start_time    between    %s    and    %s)    or\n DCTB  DCTB  DCTB  DCTB  DCTB  DCTB (end_time    between    %s    and    %s)    or\n DCTB  DCTB  DCTB  DCTB  DCTB  DCTB (%s    between    start_time    and    end_time))\n DCTB  DCTB  DCTB  DCTB ', (self.name, d.name, d.start_time, d.end_time, d.start_time, d.end_time, d.start_time))
        if existing:
            frappe.throw(_(u'Row    #{0}:    Timings    conflicts    with    row    {1}').format(d.idx, comma_and(existing)), OverlapError)
