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.
 
 
 
 
 

37 lines
1.6 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!--Inherits the sale report template-->
<template id="report_sale_inherits"
inherit_id="sale.report_saleorder_document">
<!--Section subtotal calculation-->
<xpath expr="//td[@name='td_section_line']" position="before">
<t t-set="section_subtotal" t-value="0"/>
<t t-set="flag" t-value="0"/>
<t t-foreach="doc.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 the section-->
<xpath expr="//td[@name='td_section_line']" position="replace">
<td name="td_section_line" colspan="99">
<span t-field="line.name"/>
<span t-esc="section_subtotal"
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'
style="float: right;"/>
</td>
</xpath>
<xpath expr="//td[@name='td_section_subtotal']" position="replace">
</xpath>
</template>
</odoo>