Skip to content

Commit 126c5b1

Browse files
committed
[ADD] purchase_order_report_hide_tax: New module
MT-11623
1 parent 709affd commit 126c5b1

File tree

14 files changed

+625
-0
lines changed

14 files changed

+625
-0
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
======================================
2+
Purchase order line hide tax in report
3+
======================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:c3f8c634c1fae23b76f78082b36599f63225f7b3b09f33d3e5fa90f5b185f557
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Alpha
16+
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
18+
:alt: License: LGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--reporting-lightgray.png?logo=github
20+
:target: https://github.com/OCA/purchase-reporting/tree/16.0/purchase_order_report_hide_tax
21+
:alt: OCA/purchase-reporting
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/purchase-reporting-16-0/purchase-reporting-16-0-purchase_order_report_hide_tax
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-reporting&target_branch=16.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
Hide taxes column in the purchase order document that is sent to the
32+
vendor.
33+
34+
.. IMPORTANT::
35+
This is an alpha version, the data model and design can change at any time without warning.
36+
Only for development or testing purpose, do not use in production.
37+
`More details on development status <https://odoo-community.org/page/development-status>`_
38+
39+
**Table of contents**
40+
41+
.. contents::
42+
:local:
43+
44+
Use Cases / Context
45+
===================
46+
47+
When the taxes are the same in every purchase line, that information
48+
might be redundant with the taxes summary and takes valuable space that
49+
other columns might take.
50+
51+
This might be event more annoying when there's tax exemptions like in EU
52+
intracomunitary operations.
53+
54+
Usage
55+
=====
56+
57+
Whenever the taxes are in the same group for the whole order the column
58+
won't be displayed in the purchase order printed report.
59+
60+
Bug Tracker
61+
===========
62+
63+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-reporting/issues>`_.
64+
In case of trouble, please check there if your issue has already been reported.
65+
If you spotted it first, help us to smash it by providing a detailed and welcomed
66+
`feedback <https://github.com/OCA/purchase-reporting/issues/new?body=module:%20purchase_order_report_hide_tax%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
67+
68+
Do not contact contributors directly about support or help with technical issues.
69+
70+
Credits
71+
=======
72+
73+
Authors
74+
-------
75+
76+
* Moduon
77+
78+
Contributors
79+
------------
80+
81+
- David Vidal (``Moduon <https://www.moduon.team/>``\ \_\_)
82+
83+
Maintainers
84+
-----------
85+
86+
This module is maintained by the OCA.
87+
88+
.. image:: https://odoo-community.org/logo.png
89+
:alt: Odoo Community Association
90+
:target: https://odoo-community.org
91+
92+
OCA, or the Odoo Community Association, is a nonprofit organization whose
93+
mission is to support the collaborative development of Odoo features and
94+
promote its widespread use.
95+
96+
.. |maintainer-chienandalu| image:: https://github.com/chienandalu.png?size=40px
97+
:target: https://github.com/chienandalu
98+
:alt: chienandalu
99+
.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px
100+
:target: https://github.com/rafaelbn
101+
:alt: rafaelbn
102+
103+
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
104+
105+
|maintainer-chienandalu| |maintainer-rafaelbn|
106+
107+
This module is part of the `OCA/purchase-reporting <https://github.com/OCA/purchase-reporting/tree/16.0/purchase_order_report_hide_tax>`_ project on GitHub.
108+
109+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2025 Moduon Team S.L.
2+
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)
3+
{
4+
"name": "Purchase order line hide tax in report",
5+
"summary": "Hide taxes column when they don't add value",
6+
"version": "16.0.1.0.1",
7+
"development_status": "Alpha",
8+
"category": "Purchases",
9+
"website": "https://github.com/OCA/purchase-reporting",
10+
"author": "Moduon, Odoo Community Association (OCA)",
11+
"maintainers": ["chienandalu", "rafaelbn"],
12+
"license": "LGPL-3",
13+
"depends": ["purchase"],
14+
"data": [
15+
"reports/purchase_order_report_template.xml",
16+
],
17+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import purchase_order
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2025 Moduon Team S.L.
2+
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)
3+
from odoo import fields, models
4+
5+
6+
class PurchaseOrder(models.Model):
7+
_inherit = "purchase.order"
8+
9+
show_tax_column_in_report = fields.Boolean(
10+
compute="_compute_show_tax_column_in_report"
11+
)
12+
13+
def _compute_show_tax_column_in_report(self):
14+
self.show_tax_column_in_report = True
15+
for order in self.filtered("order_line"):
16+
order_lines = order.order_line.filtered(lambda x: not x.display_type)
17+
# Can be a recordset if several taxes apply
18+
first_line_tax_group = fields.first(order_lines).taxes_id.tax_group_id
19+
# Mixed group taxes, let's show them for clarity
20+
order.show_tax_column_in_report = (
21+
first_line_tax_group != order_lines.taxes_id.tax_group_id
22+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
When the taxes are the same in every purchase line, that information might be redundant with the taxes summary and takes valuable space that other columns might take.
2+
3+
This might be event more annoying when there's tax exemptions like in EU intracomunitary operations.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* David Vidal (`Moduon <https://www.moduon.team/>`__)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hide taxes column in the purchase order document that is sent to the vendor.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Whenever the taxes are in the same group for the whole order the column won't be
2+
displayed in the purchase order printed report.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<odoo>
3+
<template
4+
id="report_purchaseorder_document"
5+
inherit_id="purchase.report_purchaseorder_document"
6+
>
7+
<xpath expr="//th[@name='th_taxes']" position="attributes">
8+
<attribute name="t-if">o.show_tax_column_in_report</attribute>
9+
</xpath>
10+
<xpath expr="//td[@name='td_taxes']" position="attributes">
11+
<attribute name="t-if">o.show_tax_column_in_report</attribute>
12+
</xpath>
13+
</template>
14+
</odoo>

0 commit comments

Comments
 (0)