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

审批流(入职记录)修改逻辑

XMLWord打印

    • Icon: Change Change
    • 解决结果: 完成
    • Icon: Medium Medium
    • 202012
    • Y-易路产品-
    • 好孩子
    • 基础通用功能
    • 隐藏

      result = True
      if record.x_cqwrz == 'A02':
      result = False
      user_group_code = ['R008','R009','R133','R229','R081','R173']
      eroad_ids = env['eroad.role'].search([('code','in',user_group_code)])
      user_ids = []
      for eroad in eroad_ids:
      if eroad.user_ids:
      for user in eroad.user_ids:
      user_ids.append(user.id)

      1. raise ValidationError('可提交人员%s' % user_ids)
        if record.submitter.id not in user_ids:
        raise ValidationError('您不可以提交该单据,请联系总部')
        age_bs = 16 #2019.11.09,王辉、吴春亚沟通后将年龄标准由18岁调整为17岁;2019.12.06,吴春亚沟通后将年龄标准由17岁调整为16岁;2020.07.22汪莉彬邮件说将年龄由16岁改为18岁;2020.08.03汪莉彬邮件要求将年龄由18岁改为16岁
        if record.birth_date and record.estimated_onboard_date:
      2. if record.applicant_id.birth_date and record.estimated_onboard_date:

      a = int(record.birth_date[:4])

      1. a = int(record.applicant_id.birth_date[:4])
        b = int(record.estimated_onboard_date[:4])
        c = int(record.birth_date[5:7])
      2. c = int(record.applicant_id.birth_date[5:7])
        d = int(record.estimated_onboard_date[5:7])
        e = int(record.birth_date[8:])
      3. e = int(record.applicant_id.birth_date[8:])
        f = int(record.estimated_onboard_date[8:])
        if b-a>age_bs:
        result=True
        elif b-a==age_bs and d-c>0:
        result=True
        elif b-a==age_bs and d-c==0 and f-e>0:
        result=True
        elif b-a==age_bs and d-c==0 and f-e==0:
        result=True
        else:
        raise ValidationError('不满16周岁')
        elif record.organization_unit.department_code != record.job_id.department_id.department_code:
        raise ValidationError('组织单元与岗位不匹配')
        elif record.employee_number and record.identification_number:
        history_departure_obj = env['history.departure'].search([('identification_id','=', record.identification_number),('active','=',True)],order='departure_date desc',limit=1)
        employee_obj = env['hr.employee'].search([('identification_id','=', record.identification_number),('active','=',True)])
        if history_departure_obj:
        if history_departure_obj.employee_number != record.employee_number:
        raise ValidationError('员工编号错误,无法提交!')
        if employee_obj:
        if employee_obj.employee_number != record.employee_number:
        raise ValidationError('员工编号错误,无法提交!')
      显示
      result = True if record.x_cqwrz == 'A02': result = False user_group_code = ['R008','R009','R133','R229','R081','R173'] eroad_ids = env ['eroad.role'] .search( [('code','in',user_group_code)] ) user_ids = [] for eroad in eroad_ids: if eroad.user_ids: for user in eroad.user_ids: user_ids.append(user.id) raise ValidationError('可提交人员%s' % user_ids) if record.submitter.id not in user_ids: raise ValidationError('您不可以提交该单据,请联系总部') age_bs = 16 #2019.11.09,王辉、吴春亚沟通后将年龄标准由18岁调整为17岁;2019.12.06,吴春亚沟通后将年龄标准由17岁调整为16岁;2020.07.22汪莉彬邮件说将年龄由16岁改为18岁;2020.08.03汪莉彬邮件要求将年龄由18岁改为16岁 if record.birth_date and record.estimated_onboard_date: if record.applicant_id.birth_date and record.estimated_onboard_date: a = int(record.birth_date [:4] ) a = int(record.applicant_id.birth_date [:4] ) b = int(record.estimated_onboard_date [:4] ) c = int(record.birth_date [5:7] ) c = int(record.applicant_id.birth_date [5:7] ) d = int(record.estimated_onboard_date [5:7] ) e = int(record.birth_date [8:] ) e = int(record.applicant_id.birth_date [8:] ) f = int(record.estimated_onboard_date [8:] ) if b-a>age_bs: result=True elif b-a==age_bs and d-c>0: result=True elif b-a==age_bs and d-c==0 and f-e>0: result=True elif b-a==age_bs and d-c==0 and f-e==0: result=True else: raise ValidationError('不满16周岁') elif record.organization_unit.department_code != record.job_id.department_id.department_code: raise ValidationError('组织单元与岗位不匹配') elif record.employee_number and record.identification_number: history_departure_obj = env ['history.departure'] .search( [('identification_id','=', record.identification_number),('active','=',True)] ,order='departure_date desc',limit=1) employee_obj = env ['hr.employee'] .search( [('identification_id','=', record.identification_number),('active','=',True)] ) if history_departure_obj: if history_departure_obj.employee_number != record.employee_number: raise ValidationError('员工编号错误,无法提交!') if employee_obj: if employee_obj.employee_number != record.employee_number: raise ValidationError('员工编号错误,无法提交!')

      超期未入职的入职记录单据走另外一条审批流,由固定人员审批为已拒绝

            wenqiang.liu 刘文强
            cherry.zhen 甄瑞辰
            表决:
            0 为这个问题表决

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