forked from OCA/account-invoicing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport_account_invoice.xml
More file actions
43 lines (41 loc) · 1.91 KB
/
report_account_invoice.xml
File metadata and controls
43 lines (41 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!-- Copyright 2017 ForgeFlow S.L.
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<template id="report_invoice_document" inherit_id="account.report_invoice_document">
<xpath expr="//t[@t-set='display_discount']" position="after">
<t
t-set="display_discount_fixed"
t-value="any([l.discount_fixed for l in o.invoice_line_ids])"
/>
</xpath>
<xpath expr="//th[@name='th_price_unit']" position="attributes">
<attribute name="t-if" add="display_discount_fixed" separator=" or " />
</xpath>
<xpath expr="//th[@name='th_price_unit']/span" position="attributes">
<attribute name="t-if" add="not display_discount_fixed" separator=" or " />
</xpath>
<xpath expr="//th[@name='th_price_unit']/span" position="before">
<t t-if="display_discount_fixed">
<span>Discount Amount (%)</span>
</t>
</xpath>
<xpath expr="//span[@t-field='line.discount']/.." position="attributes">
<attribute name="t-if" add="display_discount_fixed" separator=" or " />
</xpath>
<xpath expr="//span[@t-field='line.discount']" position="attributes">
<attribute name="t-if" add="line.discount_fixed" separator=" or " />
</xpath>
<xpath expr="//span[@t-field='line.discount']" position="before">
<t t-if="display_discount_fixed and line.discount_fixed">
<span class="text-nowrap" t-field="line.discount_fixed" /><span
class="text-nowrap"
> (or</span>
</t>
</xpath>
<xpath expr="//span[@t-field='line.discount']" position="after">
<t t-if="display_discount_fixed and line.discount_fixed"><span
class="text-nowrap"
> %)</span></t>
</xpath>
</template>
</odoo>