我正在 Qweb 视图中进行报告。但不知道如何从 sale.order.line 访问字段 sale.order 。也许这个问题很简单,但我只是在介绍 Odoo。我需要帮助。
在这里,我向您展示我对 Qweb 的看法:
<?xml version="1.0"?>
<t t-name="sale.ticket_servicio">
<t t-foreach="docs" t-as="o">
<div class="page">
<div class="header">
<div class="row">
<div class="col-xs-4 col-xs-offset-6">
<img src="#"/>
</div>
</div>
</div>
<div class="body">
<div class="col-xs-12">
<p>Orden Number:<span t-field="o.name"></span></p> **(HERE NEED TO ACCESS TO ORDER NUMBER) e.x:SO003**
</div>
<div class="col-xs-12">
<p>Partner: </p> **(HERE NEED TO ACCESS TO PARTNER NAME)**
</div>
<div class="col-xs-12">
<p>NIU: <span t-field="o.niu"></span></p>
</div>
<div class="col-xs-12">
<p>Product name: <span t-field="o.product_id.name_template"></span></p>
</div>
<div class="col-xs-12">
<p>Lot: </p> **(HERE NEED TO ACCESS TO LOT)**
</div>
<div class="col-xs-12">
<p>Date order: </p> **(HERE NEED TO ACCESS TO DATE ORDER)**
</div>
</div>
</div>
</t>
</t>