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

贝卡尔特 员工自助离职界面字段【No Show】和【江阴人社系统退工原因】判断逻辑

XMLWord打印

    • B-贝卡尔特-Y2019053
    • STD
    • 贝卡尔特bekaert
    • 基础通用功能
    • 隐藏

      1.原因类别和离职原因必填视图配置

      <?xml version="1.0"?>
      <data>
          <xpath expr="//field[@name='reason_leave_type']" position="replace">
                <field name="reason_leave_type" domain="[('applied_hr_termination', '=', True)]" options="{'no_open':True,'no_create':True}" attrs="{'readonly':[('is_readonly_reason', '=', True)]}"/>
            </xpath>
            <xpath expr="//field[@name='reason_leave']" position="replace">
                <field name="reason_leave" domain="[('reason_type_id', '=', reason_leave_type),('active_show', '=', True)]" options="{'no_open':True,'no_create':True}" attrs="{'readonly':[('is_readonly_reason', '=', True)]}"/>
            </xpath>
      </data>
      

      2. 江阴人社系统退工原因必填视图配置

      <?xml version="1.0"?>
      <data>
          <xpath expr="//field[@name='social_security_end_month']" position="after">
              <field name='x_b005' attrs="{'required':[('x_legalentity','in',[4,5,6,7,19])]}"/>
          </xpath>
      </data>
      

      3.自定义关联变更配置:

      values = kwargs.setdefault('values', {})
      legalentity = values.get('x_legalentity')
      is_show_of_report = values.get('is_show_of_report')
      reason_leave_type = values.get('reason_leave_type')
      reason_leave = values.get('reason_leave')
      
      if isinstance(legalentity, int):
          legalentity = env['legal.enity'].search([('id', '=', legalentity)])
      
      if isinstance(reason_leave_type, int):
          reason_leave_type = env['reason.leave.type'].search([('id', '=', reason_leave_type)])
      
      if isinstance(reason_leave, int):
          reason_leave = env['reason.leave'].search([('id', '=', reason_leave)])
      
      if legalentity.code in ['L004', 'L003', 'L002', 'L005', 'LE004']:
          if is_show_of_report == '0':
              if reason_leave_type.code == 'C003' and reason_leave.code == 'L001':
                  result.update({'x_b005': '合同期满'})
              elif reason_leave_type.code == 'C001' and reason_leave.code in ['L002', 'L004', 'L005', 'L006']:
                  result.update({'x_b005': '单位解除合同'})
              elif reason_leave_type.code == 'C001' and reason_leave.code in ['L003']:
                  result.update({'x_b005': '双方协商一致解除'})
              elif (reason_leave_type.code == 'C004' and reason_leave.code in ['L007']) or (reason_leave_type.code == 'C002' and reason_leave.code in ['L008','L009','L010','L011','L012','L013','L014','L015','L016','L017','L018']):
                  result.update({'x_b005': '个人解除合同'})
              elif reason_leave_type.code == 'C005' and reason_leave.code in ['L019']:
                  result.update({'x_b005': '到达法定退休年龄'})
              elif reason_leave_type.code == 'C006' and reason_leave.code in ['L020']:
                  result.update({'x_b005': '企业裁员'})
              elif reason_leave_type.code == 'C007' and reason_leave.code in ['L021']:
                  result.update({'x_b005': '死亡或失踪'})
              else:
                  result.update({'x_b005': False})
          else:
              result.update({'x_b005': False})
      else:
          result.update({'x_b005': False})
      
      显示
      1.原因类别和离职原因必填视图配置 <?xml version= "1.0" ?> <data> <xpath expr= " //field[@name= 'reason_leave_type' ]" position= "replace" > <field name= "reason_leave_type" domain= "[( 'applied_hr_termination' , '=' , True)]" options= "{ 'no_open' :True, 'no_create' :True}" attrs= "{ 'readonly' :[( 'is_readonly_reason' , '=' , True)]}" /> </xpath> <xpath expr= " //field[@name= 'reason_leave' ]" position= "replace" > <field name= "reason_leave" domain= "[( 'reason_type_id' , '=' , reason_leave_type),( 'active_show' , '=' , True)]" options= "{ 'no_open' :True, 'no_create' :True}" attrs= "{ 'readonly' :[( 'is_readonly_reason' , '=' , True)]}" /> </xpath> </data> 2. 江阴人社系统退工原因必填视图配置 <?xml version= "1.0" ?> <data> <xpath expr= " //field[@name= 'social_security_end_month' ]" position= "after" > <field name= 'x_b005' attrs= "{ 'required' :[( 'x_legalentity' , 'in' ,[4,5,6,7,19])]}" /> </xpath> </data> 3.自定义关联变更配置: values = kwargs.setdefault( 'values' , {}) legalentity = values.get( 'x_legalentity' ) is_show_of_report = values.get( 'is_show_of_report' ) reason_leave_type = values.get( 'reason_leave_type' ) reason_leave = values.get( 'reason_leave' ) if isinstance(legalentity, int ): legalentity = env[ 'legal.enity' ].search([( 'id' , '=' , legalentity)]) if isinstance(reason_leave_type, int ): reason_leave_type = env[ 'reason.leave.type' ].search([( 'id' , '=' , reason_leave_type)]) if isinstance(reason_leave, int ): reason_leave = env[ 'reason.leave' ].search([( 'id' , '=' , reason_leave)]) if legalentity.code in [ 'L004' , 'L003' , 'L002' , 'L005' , 'LE004' ]: if is_show_of_report == '0' : if reason_leave_type.code == 'C003' and reason_leave.code == 'L001' : result.update({ 'x_b005' : '合同期满' }) elif reason_leave_type.code == 'C001' and reason_leave.code in [ 'L002' , 'L004' , 'L005' , 'L006' ]: result.update({ 'x_b005' : '单位解除合同' }) elif reason_leave_type.code == 'C001' and reason_leave.code in [ 'L003' ]: result.update({ 'x_b005' : '双方协商一致解除' }) elif (reason_leave_type.code == 'C004' and reason_leave.code in [ 'L007' ]) or (reason_leave_type.code == 'C002' and reason_leave.code in [ 'L008' , 'L009' , 'L010' , 'L011' , 'L012' , 'L013' , 'L014' , 'L015' , 'L016' , 'L017' , 'L018' ]): result.update({ 'x_b005' : '个人解除合同' }) elif reason_leave_type.code == 'C005' and reason_leave.code in [ 'L019' ]: result.update({ 'x_b005' : '到达法定退休年龄' }) elif reason_leave_type.code == 'C006' and reason_leave.code in [ 'L020' ]: result.update({ 'x_b005' : '企业裁员' }) elif reason_leave_type.code == 'C007' and reason_leave.code in [ 'L021' ]: result.update({ 'x_b005' : '死亡或失踪' }) else : result.update({ 'x_b005' : False}) else : result.update({ 'x_b005' : False}) else : result.update({ 'x_b005' : False})

      1.当【No Show】字段选择NO的时候,【原因类别】和【离职原因】为必填。参考PM:https://pm.ersoft.cn/browse/SLAL2-2262
      2.当Legal Entity = 江阴工厂(BBSC/CBSC/BTRD/BJWP/SSC),且选择原因类别不为【转正】,离职原因不为【实习生/外包工转正】时,【江阴人社系统退工原因】为必填。当Legal Entity= 江阴工厂(BBSC/CBSC/BTRD/BJWP/SSC), 【No Show】=”No”, 【江阴人社系统退工原因】字段,按附件逻辑自动关联出对应的依据(如附件E列); 当【No Show】 =”Yes”, 【江阴人社系统退工原因】字段为空,不需要置灰,这个时候,工厂可以自行选择;当Legal Entity≠以上工厂,【江阴人社系统退工原因】字段为空,不需要置灰。参考PM:https://pm.ersoft.cn/browse/SLAL2-2811https://pm.ersoft.cn/browse/SLAL2-2730https://pm.ersoft.cn/browse/SLAL2-3495

            ling.chen 陈灵娟
            haiya.zhang 张海娅
            表决:
            0 为这个问题表决

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

                预估时间:
                初始预估 - 尚未指定
                尚未指定
                剩余:
                剩余的估算 - 0小时
                0小时
                实际工作时间:
                耗费时间 - 2小时
                2小时