Files
enterprise-addons/account_intrastat/views/report_invoice.xml
T

26 lines
1.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_invoice_document_intrastat_2019" inherit_id="account.report_invoice_document">
<!-- if no lines has an intrastat_product_origin_country_id, we need to store it so that we can hide the column. -->
<xpath expr="//t[@t-set='display_discount']" position="after">
<t t-set="display_origin" t-value="any(l.intrastat_product_origin_country_id for l in o.invoice_line_ids)"/>
</xpath>
<xpath expr="//th[@name='th_priceunit']" position="before">
<th class="text-end" t-if="display_origin">Origin</th>
</xpath>
<xpath expr="//td//span[@t-field='line.price_unit']/.." position="before">
<td class="text-end" t-if="display_origin">
<span t-field="line.intrastat_product_origin_country_id"/>
</td>
</xpath>
<xpath expr="//td[@name='td_price_unit_grouped']" position="before">
<td class="text-end" t-if="display_origin">
<span t-out="grouped_line['intrastat_product_origin']"/>
</td>
</xpath>
<xpath expr="//t[@t-set='line_colspan']" position="attributes">
<attribute name="t-value" add="(1 if display_origin else 0)" separator=" + "/>
</xpath>
</template>
</odoo>