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.
 
 
 
 
 

35 lines
1.5 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- Inherit the purchase report template for adding the section wise subtotal -->
<template id="report_purchaseorder_document"
inherit_id="purchase.report_purchaseorder_document">
<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>
<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>
</template>
</odoo>