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

员工申请年假时剩余额度为负数时分流

XMLWord打印

    • Icon: Change Change
    • 解决结果: 完成
    • Icon: Medium Medium
    • 202101
    • L-裸心谷-OP
    • naked
    • 基础通用功能
    • 隐藏

      annual_id = env['hr.holiday.type'].search([('code','=','L001')])
      employee = record.employee_id
      result = False
      if record.holiday_type_id:
      if record.holiday_type_id.code == 'L001':
      processing_amount = 0
      processing_recs = env['hr.holiday.leave'].search([('employee_id','=',employee.id),('state','=','waiting')])
      for processing_rec in processing_recs:
      processing_amount += processing_rec.leave_total
      processing_amount += record.leave_total
      inquiry_recs = env['hr.holiday.inquiry'].search([('employee_id','=',employee.id),('holiday_type_id','=',annual_id.id)])
      balances=0
      for inquiry_rec in inquiry_recs:
      balances += inquiry_rec.balances
      if processing_amount<=balances:
      result = True

      annual_id = env['hr.holiday.type'].search([('code','=','L001')])
      employee = record.employee_id
      result = False
      if record.holiday_type_id:
      if record.holiday_type_id.code == 'L001':
      processing_amount = 0
      processing_recs = env['hr.holiday.leave'].search([('employee_id','=',employee.id),('state','=','waiting')])
      for processing_rec in processing_recs:
      processing_amount += processing_rec.leave_total
      processing_amount += record.leave_total
      inquiry_recs = env['hr.holiday.inquiry'].search([('employee_id','=',employee.id),('holiday_type_id','=',annual_id.id)])
      balances=0
      for inquiry_rec in inquiry_recs:
      balances += inquiry_rec.balances
      if processing_amount>balances:
      result = True

      显示
      annual_id = env ['hr.holiday.type'] .search( [('code','=','L001')] ) employee = record.employee_id result = False if record.holiday_type_id: if record.holiday_type_id.code == 'L001': processing_amount = 0 processing_recs = env ['hr.holiday.leave'] .search( [('employee_id','=',employee.id),('state','=','waiting')] ) for processing_rec in processing_recs: processing_amount += processing_rec.leave_total processing_amount += record.leave_total inquiry_recs = env ['hr.holiday.inquiry'] .search( [('employee_id','=',employee.id),('holiday_type_id','=',annual_id.id)] ) balances=0 for inquiry_rec in inquiry_recs: balances += inquiry_rec.balances if processing_amount<=balances: result = True annual_id = env ['hr.holiday.type'] .search( [('code','=','L001')] ) employee = record.employee_id result = False if record.holiday_type_id: if record.holiday_type_id.code == 'L001': processing_amount = 0 processing_recs = env ['hr.holiday.leave'] .search( [('employee_id','=',employee.id),('state','=','waiting')] ) for processing_rec in processing_recs: processing_amount += processing_rec.leave_total processing_amount += record.leave_total inquiry_recs = env ['hr.holiday.inquiry'] .search( [('employee_id','=',employee.id),('holiday_type_id','=',annual_id.id)] ) balances=0 for inquiry_rec in inquiry_recs: balances += inquiry_rec.balances if processing_amount>balances: result = True

      员工申请年假时剩余额度为负数时分流,到HR审批节点,不为负时到另一个节点。
      需包含当前申请的单据上的天数,以及其他待审批单据上的天数,如果申请后,年假额度为负就要到HR

            grant.yang 杨光磊
            liuxz 刘襄周
            表决:
            0 为这个问题表决

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