Skip to content
Snippets Groups Projects
Commit cb47d014 authored by Emanuel Buzey's avatar Emanuel Buzey
Browse files

[IMP] energy_selfconsumption: add custom template

parent 2319775c
No related branches found
No related tags found
3 merge requests!277[REL] Release Sprint 27/11/23,!265C2/ Implementation delivered_energy_invoice_format,!258feature/delivered_energy_invoice_format
......@@ -2,17 +2,64 @@
<odoo>
<data>
<template inherit_id="account.report_invoice_document" id="energy_delivered_invoice_template" primary="True">
<xpath expr="//table[@class='table table-sm o_main_table']" position="replace">
<h3>TEST: Custom Template</h3>
<tr t-foreach='o.invoice_line_ids' t-as='line'>
<td>
<span t-field="line.selfconsumption_id.invoicing_mode"/>
<!-- <span t-field="line.selfconsumption_id.distribution_table_ids.supply_point_assignation_ids.code[0]"/> -->
<span t-field="line.selfconsumption_id.owner_id"/>
<span t-field="line.selfconsumption_id.code"/>
</td>
</tr>
<xpath expr="//th[@name='th_quantity']" position="replace">
<th name="th_total_installation_generation"><span>Total installation generation</span></th>
</xpath>
<xpath expr="//th[@name='th_total_installation_generation']" position="after">
<th name="th_partition_coefficient"><span>Partition coefficient</span></th>
</xpath>
<xpath expr="//th[@name='th_priceunit']" position="after">
<th name="th_import"><span>Import</span></th>
</xpath>
<xpath expr="//th[@name='th_taxes']" position="replace"></xpath>
<xpath expr="//th[@name='th_subtotal']" position="replace"></xpath>
<xpath expr="//th[@name='th_partition_coefficient']" position="after">
<th name="th_total_amount_invoiced"><span>Total amount invoiced</span></th>
</xpath>
<xpath expr="//td[@name='account_invoice_line_name']" position="replace">
<td name="account_invoice_line_name">
<span>CAU: <span t-field="line.selfconsumption_id.code" /></span>
<br/>
<span t-field="line.name" t-options="{'widget': 'text'}"/>
</td>
</xpath>
<xpath expr="//td[@name='account_invoice_line_name']" position="after">
<td name="td_total_installation_generation">
<span t-field="line.selfconsumption_id.power" /><span> kWh</span>
</td>
</xpath>
<xpath expr="//td[@name='td_total_installation_generation']" position="after">
<td name="td_partition_coefficient">
<t t-foreach="line.selfconsumption_id.distribution_table_ids.supply_point_assignation_ids" t-as="assignation">
<t t-if="assignation.owner_id.name == line.partner_id.name">
<span t-field="assignation.coefficient"/>
</t>
</t>
</td>
</xpath>
<xpath expr="//td[@name='td_partition_coefficient']" position="after">
<td name="td_total_amount_invoiced">kWh</td>
</xpath>
<xpath expr="//td[@name='td_total_amount_invoiced']" position="after">
<td name="td_total_amount_invoiced">
<span t-field="line.selfconsumption_id.product_id.lst_price"/><span> €/kWh</span>
</td>
</xpath>
<xpath expr="//span[@t-field='line.price_unit']" position="replace"></xpath>
<xpath expr="//span[@id='line_tax_ids']" position="replace"></xpath>
<xpath expr="//td[@class='text-right o_price_total']" position="replace"></xpath>
</template>
<template id="report_invoice_with_payments" inherit_id="account.report_invoice_with_payments">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment