2017-02-06 3 views
0

base_import 템플릿에 데모 파일 다운로드 링크를 추가하고 싶습니다.odoo에서 클라이언트 측 템플릿 상속 10

<t t-name="ImportView"> 
    <t t-set="_id" t-value="_.uniqueId('export')"/> 
    <form action="" method="post" enctype="multipart/form-data" class="oe_import"> 
     <input type="hidden" name="csrf_token" t-att-value="csrf_token"/> 
     <input type="hidden" name="session_id" 
      t-att-value="widget.session.session_id"/> 
     <input type="hidden" name="import_id"/> 
     <div class="oe_import_box col-sm-9"> 
      <div class="col-sm-12"> 
       <p>Select a CSV or Excel file to import. <a href="https://www.odoo.com/documentation/user/10.0/general/base_import/import_faq.html" target="new" class="pull-right">Help</a></p> 
      </div> 
      <div class="col-sm-10"> 
       <div class="input-group"> 
        <input type="text" class="oe_import_file_show form-control" placeholder="No file chosen..."/> 
        <span class="input-group-btn"> 
        <label class="btn btn-primary" for="my-file-selector"> 
        <input accept=".csv, .xls, .xlsx, .ods" id-attf-id="file_#{_id}" 
        name="file" id="my-file-selector" class="oe_import_file" type="file" style="display:none;"/> 
        Load File 
        </label> 
        </span> 
        <span class="input-group-btn"> 
        <button type="button" class="btn btn-default oe_import_file_reload" disabled="disabled">Reload File</button> 
        </span> 
       </div> 
      </div> 
      <!-- More code --> 
     </div> 
    </form> 
</t> 

내가이 링크 추가를 위해 작성하는 코드 : 원래 템플릿은 아래 표와 같이 그 것이다

<t t-name="BaseImportCustom" t-extend="ImportView"> 
    <t t-jquery="form.oe_import" t-operation="append"> 
     <p><a href="https://path-to-file" target="new" class="pull-right">Download Demo</a></p> 
    </t> 
</t> 

하지만이 링크를 표시하지, 누군가가 작동하지 알고 있기 때문에? 또는이

답변

0
  1. 먼저 한 번 확인 xml 파일이 이미 새 모듈의 __manifest__.py에 선언 할 수 없다면 다른 방법이 존재한다면?
  2. 두 번째로 확장보기에 t-name="BaseImportCustom"을 추가하면 안됩니다. 문제가 t-name="BaseImportCustom"에서 발생한다고 생각하면 Odoo의 모든 xml 파일을 "t-extend"키를 사용하여 검색하고 "t-extend"이없는 경우를 알 수 있습니다 "t-name". 나는
<t t-extend="ImportView"> 
    <t t-jquery="form.oe_import" t-operation="append"> 
     <p><a href="https://path-to-file" target="new" class="pull-right">Download Demo</a></p> 
    </t> 
</t> 
(아직 테스트하지)이 확인 바랍니다