Я пытаюсь добавить дополнительную строку в заказ на продажу между общей стоимостью без налогов и общей стоимостью налогов. При просмотре строки report_saleorder.xml
my следует добавить следующий код:
<div class="row">
<div class="col-xs-4 pull-right">
<table class="table table-condensed">
<tr class="border-black">
<td><strong>Total Without Taxes</strong></td>
<td class="text-right">
<span t-field="o.amount_untaxed"
t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
</td>
</tr>
<tr>
<td>Taxes</td>
<td class="text-right">
<span t-field="o.amount_tax"
t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
</td>
</tr>
<tr class="border-black">
<td><strong>Total</strong></td>
<td class="text-right">
<span t-field="o.amount_total"
t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
</td>
</tr>
</table>
</div>
</div>
Поскольку редактирование основного xml не вариант, мне было интересно, можно ли это сделать с помощью <xpath>
, но я не уверен, как это сделать. Я уже создал field
в своем файле sale.py, и, глядя на их код, мой xml должен выглядеть примерно так
<tr>
<td>Insurance</td>
<td class="text-right">
<span t-field="o.amount_insurance" t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
</td>
</tr>
Любая помощь в том, как я смогу это сделать, будет очень признательна