我正在尝试自定义report_purchasequotation.xml和report_purchaseorder.xml。我添加了一个新的th以在我的报告中添加供应商的产品参考。我的问题是当我使用span t-field="order_line.product_id.product_code"(模型 product.supplierinfo 中的字段 product_code )时,它显示错误QWebException: 'product_code'。请问有什么帮助吗?
<table class="table table-condensed">
<thead>
<tr>
<th><strong>Article</strong></th>
<th><strong>Référence fournisseur</strong></th>
<th><strong>Désignation</strong></th>
<th class="text-center"><strong>Expected Date</strong></th>
<th class="text-right"><strong>Qty</strong></th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.order_line" t-as="order_line">
<td>
<span t-field="order_line.name"/>
</td>
<td>
<span t-field="order_line.product_id.product_code"/>
</td>
<td>
</td>
<td class="text-center">
<span t-field="order_line.date_planned"/>
</td>
<td class="text-right">
<span t-field="order_line.product_qty"/>
<span t-field="order_line.product_uom" groups="product.group_uom"/>
</td>
</tr>
</tbody>
</table>