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

伏达-帮忙取一级或二级部门的占位符表达式取值

XMLWord打印

    • Icon: Change Change
    • 解决结果: 完成
    • Icon: Medium Medium
    • 202102
    • F-伏达半导体-Y2021002
    • 人力资源等
    • 隐藏

      result = ''
      if record.department_id:
      department = record.department_id
      if department.code == 'DP0001':
      result = department.name
      elif department.parent_department_id.code == 'DP0001':
      result = department.name
      elif department.parent_department_id.parent_department_id.code == 'DP0001':
      result = department.parent_department_id.name
      elif department.parent_department_id.parent_department_id.parent_department_id.code == 'DP0001':
      result = department.parent_department_id.parent_department_id.name
      elif department.parent_department_id.parent_department_id.parent_department_id.parent_department_id.code == 'DP0001':
      result = department.parent_department_id.parent_department_id.parent_department_id.name
      else:
      result = ''
      else:
      result = ''

      显示
      result = '' if record.department_id: department = record.department_id if department.code == 'DP0001': result = department.name elif department.parent_department_id.code == 'DP0001': result = department.name elif department.parent_department_id.parent_department_id.code == 'DP0001': result = department.parent_department_id.name elif department.parent_department_id.parent_department_id.parent_department_id.code == 'DP0001': result = department.parent_department_id.parent_department_id.name elif department.parent_department_id.parent_department_id.parent_department_id.parent_department_id.code == 'DP0001': result = department.parent_department_id.parent_department_id.parent_department_id.name else: result = '' else: result = ''

      员工开在职证明时,部门只显示一级部门或二级部门,帮忙写个代码。

      查找逻辑,通过当前记录的部门进行查找
      判断逻辑,供参考

      组织架构图,供参考

      客户环境
      https://nuvoltatest.peoplus.cn/ system / 1qazXDR%

        1. image.png
          65 kB
          于明朝
        2. 员工证明.png
          66 kB
          于明朝
        3. 组织架构图.png
          27 kB
          于明朝

            wenqiang.liu 刘文强
            yumch 于明朝
            表决:
            0 为这个问题表决

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