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

MHD-员工公司和法定年假转结

XMLWord打印

    • Icon: 测试 测试
    • 解决结果: 完成
    • Icon: Medium Medium
    • 202010
    • Y-易路产品-
    • 时间管理
    • 隐藏

      代码如下:
      holiday_type_id_ann = env['hr.holiday.type'].search([('code', '=', 'L004')]).id
      holiday_type_id_com = env['hr.holiday.type'].search([('code', '=', 'L005')]).id
      leg_holiday_records = env['hr.holiday.inquiry'].search([('employee_id', '=', employee.id),('holiday_period_id','=',previous_period.id), ('holiday_type_id','=',holiday_type_id_ann)])
      comp_holiday_records = env['hr.holiday.inquiry'].search([('employee_id', '=', employee.id),('holiday_period_id','=',previous_period.id), ('holiday_type_id','=',holiday_type_id_com)])
      leg_num=0
      for leg_rec in leg_holiday_records:
      leg_num += leg_rec.invalid_num
      com_num = 0
      for com_rec in comp_holiday_records:
      com_num += com_rec.invalid_num

      if leg_num >= 5:
      max_leg_num = 5
      else:
      max_leg_num = leg_num
      max_com_num = 5 - max_leg_num

      result=[

      { 'employee_id': employee.id, 'holiday_type_id': env.ref('hr_holiday_management.legal_annual_leave_type').id, 'max_num': max_leg_num, 'product_uom_id': env.ref('hr_holiday_management.legal_annual_allot_rule_default').product_uom_id.id, }

      ,

      { 'employee_id': employee.id, 'holiday_type_id': holiday_type_id_com, 'max_num': max_com_num, 'product_uom_id': env.ref('hr_holiday_management.legal_annual_allot_rule_default').product_uom_id.id, }

      ]

      显示
      代码如下: holiday_type_id_ann = env ['hr.holiday.type'] .search( [('code', '=', 'L004')] ).id holiday_type_id_com = env ['hr.holiday.type'] .search( [('code', '=', 'L005')] ).id leg_holiday_records = env ['hr.holiday.inquiry'] .search( [('employee_id', '=', employee.id),('holiday_period_id','=',previous_period.id), ('holiday_type_id','=',holiday_type_id_ann)] ) comp_holiday_records = env ['hr.holiday.inquiry'] .search( [('employee_id', '=', employee.id),('holiday_period_id','=',previous_period.id), ('holiday_type_id','=',holiday_type_id_com)] ) leg_num=0 for leg_rec in leg_holiday_records: leg_num += leg_rec.invalid_num com_num = 0 for com_rec in comp_holiday_records: com_num += com_rec.invalid_num if leg_num >= 5: max_leg_num = 5 else: max_leg_num = leg_num max_com_num = 5 - max_leg_num result=[ { 'employee_id': employee.id, 'holiday_type_id': env.ref('hr_holiday_management.legal_annual_leave_type').id, 'max_num': max_leg_num, 'product_uom_id': env.ref('hr_holiday_management.legal_annual_allot_rule_default').product_uom_id.id, } , { 'employee_id': employee.id, 'holiday_type_id': holiday_type_id_com, 'max_num': max_com_num, 'product_uom_id': env.ref('hr_holiday_management.legal_annual_allot_rule_default').product_uom_id.id, } ]

      客户希望法定年假和公司年假结转,设置结转固定值最大5天上限,能做到total的方式,望研发支持看下能否实现

      system
      Rs660uaT

            grant.yang 杨光磊
            jam.zhou 周佳敏
            表决:
            0 为这个问题表决

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