You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

38 lines
1.6 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!--Inherits the purchase order report template-->
<template id="report_purchase_order_inherits"
inherit_id="purchase.report_purchaseorder_document">
<!--Section subtotal calculation-->
<xpath expr="//td[@id='section']" position="before">
<span t-esc="o.name"/>
<t t-set="section_subtotal" t-value="0"/>
<t t-set="flag" t-value="0"/>
<t t-foreach="o.order_line" t-as="rec">
<t t-if="line_index == rec_index or flag == 1">
<t t-if="rec.display_type != 'line_section'">
<t t-set="section_subtotal" t-value="section_subtotal + rec.price_subtotal"/>
<t t-set="flag" t-value="1"/>
</t>
<t t-elif="line_index == rec_index">
<t t-set="flag" t-value="1"/>
</t>
<t t-else="">
<t t-set="flag" t-value="0"/>
</t>
</t>
</t>
</xpath>
<!--Add section subtotal in section-->
<xpath expr="//td[@id='section']" position="replace">
<td colspan="99" id="section">
<span t-field="line.name"/>
<span t-esc="section_subtotal"
style="float: right;"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</xpath>
<xpath expr="//td[@id='subtotal']" position="replace">
</xpath>
</template>
</odoo>