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

联蔚审批规则:按成本中心流转

XMLWord打印

    • Icon: Change Change
    • 解决结果: 完成
    • Icon: Medium Medium
    • 202101
    • L-联蔚信息-Y2018072
    • contextuat
    • 基础通用功能
    • 隐藏

      校验:
      result = True
      if record.employee_id.employee_type_rep:
      if record.employee_id.employee_type_rep.code=='O_CN':
      if record.product_uom_id.name=='小时' or record.product_uom_id.name=='Hour(s)':
      total_time = record.leave_total
      else:
      total_time = record.leave_total*8
      annual_id = env['hr.holiday.type'].search([('code','=','L001')])
      holiday_recs = env['hr.holiday.leave'].search([('employee_id','=',record.employee_id.id),('holiday_type_id','=',annual_id.id),('state','in',['waiting','done']),('active','=',True)])
      for holiday_rec in holiday_recs:
      if holiday_rec.product_uom_id.name=='小时' or holiday_rec.product_uom_id.name=='Hour(s)':
      total_time += holiday_rec.leave_total
      else:
      total_time = holiday_rec.leave_total*8
      if total_time>24:
      raise ValidationError('试用期员工年休假不能超过3天,加上本次申请已经累计申请{}小时'.format(str(total_time)))

      分流:
      result = False
      cost_centers = ['DT-2191', 'DT-2195', 'DT-2198']
      if record.employee_id.cost_center:
      if record.employee_id.cost_center.code in cost_centers:
      result = True

      result = False
      cost_centers = ['DT-2109', 'DT-2192', 'DT-2193', 'DT-2196','DT-2199']
      if record.employee_id.cost_center:
      if record.employee_id.cost_center.code in cost_centers:
      result = True

      显示
      校验: result = True if record.employee_id.employee_type_rep: if record.employee_id.employee_type_rep.code=='O_CN': if record.product_uom_id.name=='小时' or record.product_uom_id.name=='Hour(s)': total_time = record.leave_total else: total_time = record.leave_total*8 annual_id = env ['hr.holiday.type'] .search( [('code','=','L001')] ) holiday_recs = env ['hr.holiday.leave'] .search([('employee_id','=',record.employee_id.id),('holiday_type_id','=',annual_id.id),('state','in', ['waiting','done'] ),('active','=',True)]) for holiday_rec in holiday_recs: if holiday_rec.product_uom_id.name=='小时' or holiday_rec.product_uom_id.name=='Hour(s)': total_time += holiday_rec.leave_total else: total_time = holiday_rec.leave_total*8 if total_time>24: raise ValidationError('试用期员工年休假不能超过3天,加上本次申请已经累计申请{}小时'.format(str(total_time))) 分流: result = False cost_centers = ['DT-2191', 'DT-2195', 'DT-2198'] if record.employee_id.cost_center: if record.employee_id.cost_center.code in cost_centers: result = True result = False cost_centers = ['DT-2109', 'DT-2192', 'DT-2193', 'DT-2196','DT-2199'] if record.employee_id.cost_center: if record.employee_id.cost_center.code in cost_centers: result = True


      描述见附件

            grant.yang 杨光磊
            wangn 王念
            表决:
            0 为这个问题表决

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