-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] Add ecotax amounts in invoice report
- Loading branch information
1 parent
bf2dd62
commit 721647d
Showing
7 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<template | ||
id="report_invoice_document" | ||
inherit_id="account.report_invoice_document" | ||
priority="100" | ||
> | ||
<xpath expr="//th[@name='th_price_unit']" position="after"> | ||
<th | ||
name="th_ecotax" | ||
t-if="o.amount_ecotax" | ||
t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}" | ||
> | ||
<span name="ecotax_line_label">Eco Part Unit</span> | ||
</th> | ||
</xpath> | ||
<xpath expr="//td[span[@t-field='line.discount']]" position="after"> | ||
<td | ||
t-if="o.amount_ecotax" | ||
t-attf-class="text-center {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}" | ||
> | ||
<span | ||
class="text-nowrap" | ||
t-field="line.ecotax_amount_unit" | ||
/> | ||
</td> | ||
</xpath> | ||
</template> | ||
|
||
<template | ||
id="document_tax_totals" | ||
inherit_id="account.document_tax_totals" | ||
priority="100" | ||
> | ||
<xpath expr="//t[@t-set='subtotal_to_show']" position="before"> | ||
<tr | ||
t-if="o._name == 'account_move' and o.amount_ecotax" | ||
name="ecotax_line" | ||
> | ||
<td name="ecotax_label">Including Eco Part</td> | ||
<td class="text-end"> | ||
<span | ||
t-esc="o._get_formatted_ecotax_amount()" | ||
/> | ||
</td> | ||
</tr> | ||
</xpath> | ||
</template> | ||
</odoo> |
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
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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<template | ||
id="report_invoice_document" | ||
inherit_id="account.report_invoice_document" | ||
priority="150" | ||
> | ||
<xpath expr="//t[@t-set='taxes']" position="replace"> | ||
<t | ||
t-set="taxes" | ||
t-value="', '.join([(tax.description or tax.name) for tax in line.tax_ids.filtered(lambda t: not t.is_ecotax)])" | ||
/> | ||
</xpath> | ||
</template> | ||
|
||
<template | ||
id="document_tax_totals" | ||
inherit_id="account.document_tax_totals" | ||
priority="150" | ||
> | ||
<xpath expr="//tr[@name='ecotax_line']" position="replace"> | ||
</xpath> | ||
</template> | ||
</odoo> |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record id="view_move_line_ecotax_form" model="ir.ui.view"> | ||
<field name="model">account.move.line</field> | ||
<field name="inherit_id" ref="account_ecotax.view_move_line_ecotax_form" /> | ||
<field name="arch" type="xml"> | ||
<field name="ecotax_line_ids" position="attributes"> | ||
<attribute name="readonly">1</attribute> | ||
</field> | ||
</field> | ||
</record> | ||
</odoo> |