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

【和黄药业】定时任务设计

XMLWord打印

    • Icon: 技术问题 技术问题
    • 解决结果: 完成
    • Icon: High High
    • 202104
    • H-和黄药业-Y2019081
    • hryl-uat.shpl
    • 基础通用功能
    • 隐藏

      定期动作方法:x_insert_into_x_data_stoppay

      employee_ids = env['hr.employee'].search(cr, 1, [('departure_time', '!=', None)])
      if employee_ids:
          for employee_id in employee_ids:
              record = env['x_data_stoppay'].search(cr, 1, [('x_employee_id', '=', employee_id)])
              if record:
                  continue
              else:
                  employee_obj = env['hr.employee'].browse(cr, 1, employee_id)
                  values = {
                      "x_employee_id": employee_id,
                      "x_employee_number": employee_obj.employee_number,
                      "x_name": employee_obj.name,
                      "x_department_id": employee_obj.department_id.id,
                      "x_location_id": employee_obj.location_id.id,
                      "x_job_id": employee_obj.job_id.id,
                      "x_hiredate": employee_obj.hiredate,
                      "x_departuredate": employee_obj.departure_time
                  }
                  env['x_data_stoppay'].create(cr, 1, values)
      
      显示
      定期动作方法:x_insert_into_x_data_stoppay employee_ids = env[ 'hr.employee' ].search(cr, 1, [( 'departure_time' , '!=' , None)]) if employee_ids: for employee_id in employee_ids: record = env[ 'x_data_stoppay' ].search(cr, 1, [( 'x_employee_id' , '=' , employee_id)]) if record: continue else : employee_obj = env[ 'hr.employee' ].browse(cr, 1, employee_id) values = { "x_employee_id" : employee_id, "x_employee_number" : employee_obj.employee_number, "x_name" : employee_obj.name, "x_department_id" : employee_obj.department_id.id, "x_location_id" : employee_obj.location_id.id, "x_job_id" : employee_obj.job_id.id, "x_hiredate" : employee_obj.hiredate, "x_departuredate" : employee_obj.departure_time } env[ 'x_data_stoppay' ].create(cr, 1, values)

      设计定时任务,将hr.employee 模型中 有离职日期的员工数据插入到 自定义模型表单 x_data_stoppay 中,涉及的字段如下:

      x_employee_id 员工ID
      x_employee_number 工号
      x_name 姓名
      x_departmen_name 三级大区名称
      x_location 省份名称
      x_job 岗位名称
      x_hiredate 入职日期
      x_departuredate 离职日期

            chengdd 程丹丹
            jason.zhou 周子深
            表决:
            0 为这个问题表决

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