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

获取去年未休完的年休假和满年休假

XMLWord打印

    • Icon: Change Change
    • 解决结果: 完成
    • Icon: Medium Medium
    • 202102
    • D-大联大-Y2019122
    • 香港大联大
    • 时间管理
    • 隐藏

      因获取不到假期额度表内的去年年假数据,只能查找去年结转过来的记录,然后减去今天休假额度已申请的天数,得到结果
      for record in self:
      detail = self.env['hr.holiday.transfer.detail'].search([('transfer_period_after','=',record.holiday_package_id.holiday_period_id.id),('state','=','done'),('employee_id','=',record.id),('holiday_type_id','=',5)])
      inquery = self.env['hr.holiday.inquiry'].search([('holiday_period_id','=',record.holiday_package_id.holiday_period_id.id),('employee_id','=',record.id),('holiday_type_id','=',5)])
      balance=detail.transfer_num - inquery.used_num
      if balance <= 0:
      record['x_nxj'] = 0
      else:
      record['x_nxj'] = balance
      for record in self:
      detail = self.env['hr.holiday.transfer.detail'].search([('transfer_period_after','=',record.holiday_package_id.holiday_period_id.id),('state','=','done'),('employee_id','=',record.id),('holiday_type_id','=',21)])
      inquery = self.env['hr.holiday.inquiry'].search([('holiday_period_id','=',record.holiday_package_id.holiday_period_id.id),('employee_id','=',record.id),('holiday_type_id','=',21)])
      balance=detail.transfer_num - inquery.used_num
      if balance <= 0:
      record['x_mnxj'] = 0
      else:
      record['x_mnxj'] = balance

      显示
      因获取不到假期额度表内的去年年假数据,只能查找去年结转过来的记录,然后减去今天休假额度已申请的天数,得到结果 for record in self: detail = self.env ['hr.holiday.transfer.detail'] .search( [('transfer_period_after','=',record.holiday_package_id.holiday_period_id.id),('state','=','done'),('employee_id','=',record.id),('holiday_type_id','=',5)] ) inquery = self.env ['hr.holiday.inquiry'] .search( [('holiday_period_id','=',record.holiday_package_id.holiday_period_id.id),('employee_id','=',record.id),('holiday_type_id','=',5)] ) balance=detail.transfer_num - inquery.used_num if balance <= 0: record ['x_nxj'] = 0 else: record ['x_nxj'] = balance for record in self: detail = self.env ['hr.holiday.transfer.detail'] .search( [('transfer_period_after','=',record.holiday_package_id.holiday_period_id.id),('state','=','done'),('employee_id','=',record.id),('holiday_type_id','=',21)] ) inquery = self.env ['hr.holiday.inquiry'] .search( [('holiday_period_id','=',record.holiday_package_id.holiday_period_id.id),('employee_id','=',record.id),('holiday_type_id','=',21)] ) balance=detail.transfer_num - inquery.used_num if balance <= 0: record ['x_mnxj'] = 0 else: record ['x_mnxj'] = balance

      按之前沟通的,已在员工信息--时间档案信息下面新增了去年年休假 自定义字段,用于抓取去年未修完的年休假结余天数。

            wenqiang.liu 刘文强
            john.fang 房良兵
            表决:
            0 为这个问题表决

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