-
-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by pedrobaeza
- Loading branch information
Showing
1 changed file
with
13 additions
and
16 deletions.
There are no files selected for viewing
29 changes: 13 additions & 16 deletions
29
account_invoice_fixed_discount/reports/report_account_invoice.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,32 @@ | ||
<!-- 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" | ||
priority="101" | ||
> | ||
<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_discount']/span" position="replace"> | ||
<xpath expr="//th[@name='th_discount']/span" position="attributes"> | ||
<attribute name="t-if">not display_discount_fixed</attribute> | ||
</xpath> | ||
|
||
<xpath expr="//th[@t-if='display_discount']/span" position="before"> | ||
<t t-if="display_discount_fixed"> | ||
<span>Discount Amount (%)</span> | ||
</t> | ||
<t t-else=""> | ||
<span>Disc. %</span> | ||
</t> | ||
</xpath> | ||
<span t-field="line.discount" position="replace"> | ||
|
||
<span t-field="line.discount" position="before"> | ||
<t t-if="display_discount_fixed"> | ||
<span class="text-nowrap" t-field="line.discount_fixed" /> (or <span | ||
<span class="text-nowrap" t-field="line.discount_fixed" /><span | ||
class="text-nowrap" | ||
t-field="line.discount" | ||
/> %) | ||
</t> | ||
<t t-else=""> | ||
<span class="text-nowrap" t-field="line.discount" /> | ||
> (or</span> | ||
</t> | ||
</span> | ||
<span t-field="line.discount" position="after"> | ||
<t t-if="display_discount_fixed"><span class="text-nowrap"> %)</span></t> | ||
</span> | ||
</template> | ||
</odoo> |