上传的图像用于项目: 'CST技术支持'
  1. CST技术支持
  2. SLAL2-2520

【PRO-Linkflow】加班休假规则配置

XMLWord打印

    • Icon: Change Change
    • 解决结果: 完成
    • Icon: Block Block
    • 202105
    • L-LINKFLOW-Y2020064
    • 时间管理
    • 隐藏
      1. 休息日加班
        for line in self.overtime_lines:
        if line.overtime_type.sequence=='OTTYPE12958432':
        result=True
        break
        #节假日field
        the_dep = self.employee_id.department_id
        dep_codes = [the_dep.code]
        while the_dep.parent_department_id:
        dep_codes.append(the_dep.parent_department_id.code)
        the_dep = the_dep.parent_department_id
        if 'DP058' in dep_codes:
        is_DP058 = True
        else:
        is_DP058 = False
        jiejiari=False
        for line in self.overtime_lines:
        if line.overtime_type.sequence=='OTTYPE68391546':
        jiejiari=True
        break
        if jiejiari and is_DP058:
        result = True
        #节假日其他
        the_dep = self.employee_id.department_id
        dep_codes = [the_dep.code]
        while the_dep.parent_department_id:
        dep_codes.append(the_dep.parent_department_id.code)
        the_dep = the_dep.parent_department_id
        if 'DP058' in dep_codes:
        is_DP058 = True
        else:
        is_DP058 = False

      jiejiari=False
      for line in self.overtime_lines:
      if line.overtime_type.sequence=='OTTYPE68391546':
      jiejiari=True
      break
      if jiejiari and not is_DP058:
      result = True

      #'L001','L006','L007','L012'假期小于24小时
      type_code = self.holiday_type_id.code
      leave_hours = self.leave_total if self.product_uom_id.name in ['Hour(s)','小时'] else self.leave_total*8
      const_code = ['L001','L006','L007','L012']
      if type_code in const_code and leave_hours<24:
      result = True

      #[('L001','L006','L007','L012'假期大于等于24小时)或(其他假期)]且是field部门
      type_code = self.holiday_type_id.code
      leave_hours = self.leave_total if self.product_uom_id.name in ['Hour(s)','小时'] else self.leave_total*8
      const_code = ['L001','L006','L007','L012']
      if (type_code in const_code and leave_hours>=24) or type_code not in const_code:
      is_cond = True

      the_dep = self.employee_id.department_id
      dep_codes = [the_dep.code]
      while the_dep.parent_department_id:
      dep_codes.append(the_dep.parent_department_id.code)
      the_dep = the_dep.parent_department_id
      if 'DP058' in dep_codes:
      is_DP058 = True
      else:
      is_DP058 = False
      if is_cond and is_DP058

      #[('L001','L006','L007','L012'假期大于等于24小时)或(其他假期)]且非field部门
      type_code = self.holiday_type_id.code
      leave_hours = self.leave_total if self.product_uom_id.name in ['Hour(s)','小时'] else self.leave_total*8
      const_code = ['L001','L006','L007','L012']
      if (type_code in const_code and leave_hours>=24) or type_code not in const_code:
      is_cond = True

      the_dep = self.employee_id.department_id
      dep_codes = [the_dep.code]
      while the_dep.parent_department_id:
      dep_codes.append(the_dep.parent_department_id.code)
      the_dep = the_dep.parent_department_id
      if 'DP058' in dep_codes:
      is_DP058 = True
      else:
      is_DP058 = False
      if is_cond and not is_DP058

      显示
      休息日加班 for line in self.overtime_lines: if line.overtime_type.sequence=='OTTYPE12958432': result=True break #节假日field the_dep = self.employee_id.department_id dep_codes = [the_dep.code] while the_dep.parent_department_id: dep_codes.append(the_dep.parent_department_id.code) the_dep = the_dep.parent_department_id if 'DP058' in dep_codes: is_DP058 = True else: is_DP058 = False jiejiari=False for line in self.overtime_lines: if line.overtime_type.sequence=='OTTYPE68391546': jiejiari=True break if jiejiari and is_DP058: result = True #节假日其他 the_dep = self.employee_id.department_id dep_codes = [the_dep.code] while the_dep.parent_department_id: dep_codes.append(the_dep.parent_department_id.code) the_dep = the_dep.parent_department_id if 'DP058' in dep_codes: is_DP058 = True else: is_DP058 = False jiejiari=False for line in self.overtime_lines: if line.overtime_type.sequence=='OTTYPE68391546': jiejiari=True break if jiejiari and not is_DP058: result = True #'L001','L006','L007','L012'假期小于24小时 type_code = self.holiday_type_id.code leave_hours = self.leave_total if self.product_uom_id.name in ['Hour(s)','小时'] else self.leave_total*8 const_code = ['L001','L006','L007','L012'] if type_code in const_code and leave_hours<24: result = True # [('L001','L006','L007','L012'假期大于等于24小时)或(其他假期)] 且是field部门 type_code = self.holiday_type_id.code leave_hours = self.leave_total if self.product_uom_id.name in ['Hour(s)','小时'] else self.leave_total*8 const_code = ['L001','L006','L007','L012'] if (type_code in const_code and leave_hours>=24) or type_code not in const_code: is_cond = True the_dep = self.employee_id.department_id dep_codes = [the_dep.code] while the_dep.parent_department_id: dep_codes.append(the_dep.parent_department_id.code) the_dep = the_dep.parent_department_id if 'DP058' in dep_codes: is_DP058 = True else: is_DP058 = False if is_cond and is_DP058 # [('L001','L006','L007','L012'假期大于等于24小时)或(其他假期)] 且非field部门 type_code = self.holiday_type_id.code leave_hours = self.leave_total if self.product_uom_id.name in ['Hour(s)','小时'] else self.leave_total*8 const_code = ['L001','L006','L007','L012'] if (type_code in const_code and leave_hours>=24) or type_code not in const_code: is_cond = True the_dep = self.employee_id.department_id dep_codes = [the_dep.code] while the_dep.parent_department_id: dep_codes.append(the_dep.parent_department_id.code) the_dep = the_dep.parent_department_id if 'DP058' in dep_codes: is_DP058 = True else: is_DP058 = False if is_cond and not is_DP058

      加班:系统内无法选到加班类型字段,但是客户申请休假时需要通过区分不同的加班类型走不同的审批流。
      休假:规则需要同时判断休假类型以及休假天数,并且不同的休假类型有不同的审批流程。
      详细规则见截图。
      麻烦帮忙写一下判断加班和休假的审批流分支条件

        1. image.png
          62 kB
          黄诗怡
        2. image.png
          69 kB
          黄诗怡

            grant.yang 杨光磊
            hannah.huang 黄诗怡
            表决:
            0 为这个问题表决

              创建日期:
              已更新:
              已解决: