我想在模板 base_import 中添加一个下载演示文件的链接。原始模板如下所示:
<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>
但这不显示链接,有人知道因为不起作用吗?或者如果存在另一种方式