From 02b8e6bf6511adfa0f03f709fb60a3ab1eb77a7c Mon Sep 17 00:00:00 2001 From: David Vidal Date: Thu, 30 Oct 2025 15:56:57 +0100 Subject: [PATCH 1/6] [ADD] purchase_order_report_hide_tax: New module MT-11623 --- purchase_order_report_hide_tax/README.rst | 113 +++++ purchase_order_report_hide_tax/__init__.py | 1 + .../__manifest__.py | 17 + .../i18n/purchase_order_report_hide_tax.pot | 24 + .../models/__init__.py | 1 + .../models/purchase_order.py | 22 + .../readme/CONTEXT.md | 3 + .../readme/CONTRIBUTORS.md | 1 + .../readme/DESCRIPTION.md | 1 + .../readme/USAGE.md | 2 + .../purchase_order_report_template.xml | 14 + .../static/description/icon.png | Bin 0 -> 10254 bytes .../static/description/index.html | 453 ++++++++++++++++++ 13 files changed, 652 insertions(+) create mode 100644 purchase_order_report_hide_tax/README.rst create mode 100644 purchase_order_report_hide_tax/__init__.py create mode 100644 purchase_order_report_hide_tax/__manifest__.py create mode 100644 purchase_order_report_hide_tax/i18n/purchase_order_report_hide_tax.pot create mode 100644 purchase_order_report_hide_tax/models/__init__.py create mode 100644 purchase_order_report_hide_tax/models/purchase_order.py create mode 100644 purchase_order_report_hide_tax/readme/CONTEXT.md create mode 100644 purchase_order_report_hide_tax/readme/CONTRIBUTORS.md create mode 100644 purchase_order_report_hide_tax/readme/DESCRIPTION.md create mode 100644 purchase_order_report_hide_tax/readme/USAGE.md create mode 100644 purchase_order_report_hide_tax/reports/purchase_order_report_template.xml create mode 100644 purchase_order_report_hide_tax/static/description/icon.png create mode 100644 purchase_order_report_hide_tax/static/description/index.html diff --git a/purchase_order_report_hide_tax/README.rst b/purchase_order_report_hide_tax/README.rst new file mode 100644 index 00000000..7c850276 --- /dev/null +++ b/purchase_order_report_hide_tax/README.rst @@ -0,0 +1,113 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +====================================== +Purchase order line hide tax in report +====================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:f61cb085cd5bdeb94a2f6d0b87d1f3484aa8a7c697c8c1980812b10288a24446 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/purchase-reporting/tree/16.0/purchase_order_report_hide_tax + :alt: OCA/purchase-reporting +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/purchase-reporting-16-0/purchase-reporting-16-0-purchase_order_report_hide_tax + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-reporting&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Hide taxes column in the purchase order document that is sent to the +vendor. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Use Cases / Context +=================== + +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. + +This might be event more annoying when there's tax exemptions like in EU +intracomunitary operations. + +Usage +===== + +Whenever the taxes are in the same group for the whole order the column +won't be displayed in the purchase order printed report. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Moduon + +Contributors +------------ + +- David Vidal (``Moduon ``\ \_\_) + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-chienandalu| image:: https://github.com/chienandalu.png?size=40px + :target: https://github.com/chienandalu + :alt: chienandalu +.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px + :target: https://github.com/rafaelbn + :alt: rafaelbn + +Current `maintainers `__: + +|maintainer-chienandalu| |maintainer-rafaelbn| + +This module is part of the `OCA/purchase-reporting `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/purchase_order_report_hide_tax/__init__.py b/purchase_order_report_hide_tax/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/purchase_order_report_hide_tax/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/purchase_order_report_hide_tax/__manifest__.py b/purchase_order_report_hide_tax/__manifest__.py new file mode 100644 index 00000000..1c01b1d0 --- /dev/null +++ b/purchase_order_report_hide_tax/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2025 Moduon Team S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) +{ + "name": "Purchase order line hide tax in report", + "summary": "Hide taxes column when they don't add value", + "version": "16.0.1.0.2", + "development_status": "Alpha", + "category": "Purchases", + "website": "https://github.com/OCA/purchase-reporting", + "author": "Moduon, Odoo Community Association (OCA)", + "maintainers": ["chienandalu", "rafaelbn"], + "license": "LGPL-3", + "depends": ["purchase"], + "data": [ + "reports/purchase_order_report_template.xml", + ], +} diff --git a/purchase_order_report_hide_tax/i18n/purchase_order_report_hide_tax.pot b/purchase_order_report_hide_tax/i18n/purchase_order_report_hide_tax.pot new file mode 100644 index 00000000..9665d8f2 --- /dev/null +++ b/purchase_order_report_hide_tax/i18n/purchase_order_report_hide_tax.pot @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_order_report_hide_tax +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: purchase_order_report_hide_tax +#: model:ir.model,name:purchase_order_report_hide_tax.model_purchase_order +msgid "Purchase Order" +msgstr "" + +#. module: purchase_order_report_hide_tax +#: model:ir.model.fields,field_description:purchase_order_report_hide_tax.field_purchase_order__show_tax_column_in_report +msgid "Show Tax Column In Report" +msgstr "" diff --git a/purchase_order_report_hide_tax/models/__init__.py b/purchase_order_report_hide_tax/models/__init__.py new file mode 100644 index 00000000..9f035306 --- /dev/null +++ b/purchase_order_report_hide_tax/models/__init__.py @@ -0,0 +1 @@ +from . import purchase_order diff --git a/purchase_order_report_hide_tax/models/purchase_order.py b/purchase_order_report_hide_tax/models/purchase_order.py new file mode 100644 index 00000000..d04de050 --- /dev/null +++ b/purchase_order_report_hide_tax/models/purchase_order.py @@ -0,0 +1,22 @@ +# Copyright 2025 Moduon Team S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) +from odoo import fields, models + + +class PurchaseOrder(models.Model): + _inherit = "purchase.order" + + show_tax_column_in_report = fields.Boolean( + compute="_compute_show_tax_column_in_report" + ) + + def _compute_show_tax_column_in_report(self): + self.show_tax_column_in_report = True + for order in self.filtered("order_line"): + order_lines = order.order_line.filtered(lambda x: not x.display_type) + # Can be a recordset if several taxes apply + first_line_tax_group = fields.first(order_lines).taxes_id.tax_group_id + # Mixed group taxes, let's show them for clarity + order.show_tax_column_in_report = ( + first_line_tax_group != order_lines.taxes_id.tax_group_id + ) diff --git a/purchase_order_report_hide_tax/readme/CONTEXT.md b/purchase_order_report_hide_tax/readme/CONTEXT.md new file mode 100644 index 00000000..3a09b522 --- /dev/null +++ b/purchase_order_report_hide_tax/readme/CONTEXT.md @@ -0,0 +1,3 @@ +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. + +This might be event more annoying when there's tax exemptions like in EU intracomunitary operations. diff --git a/purchase_order_report_hide_tax/readme/CONTRIBUTORS.md b/purchase_order_report_hide_tax/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..05262c2b --- /dev/null +++ b/purchase_order_report_hide_tax/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +* David Vidal (`Moduon `__) diff --git a/purchase_order_report_hide_tax/readme/DESCRIPTION.md b/purchase_order_report_hide_tax/readme/DESCRIPTION.md new file mode 100644 index 00000000..c1009acd --- /dev/null +++ b/purchase_order_report_hide_tax/readme/DESCRIPTION.md @@ -0,0 +1 @@ +Hide taxes column in the purchase order document that is sent to the vendor. diff --git a/purchase_order_report_hide_tax/readme/USAGE.md b/purchase_order_report_hide_tax/readme/USAGE.md new file mode 100644 index 00000000..1a283152 --- /dev/null +++ b/purchase_order_report_hide_tax/readme/USAGE.md @@ -0,0 +1,2 @@ +Whenever the taxes are in the same group for the whole order the column won't be +displayed in the purchase order printed report. diff --git a/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml b/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml new file mode 100644 index 00000000..a2ff8137 --- /dev/null +++ b/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml @@ -0,0 +1,14 @@ + + + + diff --git a/purchase_order_report_hide_tax/static/description/icon.png b/purchase_order_report_hide_tax/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1dcc49c24f364e9adf0afbc6fc0bac6dbecdeb11 GIT binary patch literal 10254 zcmbt)WmufcvhH9Zc!C8B?l8#UE&&o;gF7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g>{gyW!~LZpn?aZ~Va3~H0Ta)z z<4XPVk@;#%1S@fq<(2#8T04#8$mz>vM;(jek0>Qh!K%t5*4tU(fVYwD3Ri~=D!AmI zV$Dt#TEDX7{lpW%tF&DOlTO)vZodn_%wYu~)ZQ}Qo^cBbDHd{YajkzNxttQW>ST<^ z2~^xhB_y1sjIF5;xchvCn{QVugIE2eYZDZ!-Y-4lJdb34*k({@M zJ5!9Di^||~(IZ4iOoAbtggao+CaYvJynmB^;4r-tY2gS_*P!?U?hlEX;l+^*{%B2n z)|1j9wOHQQ^5Xha>{Cu8_w^8=#6;Dz7kU~RgTqn;ynDm6{xdlkf2vk0UK^oS3yVy4 zE+v&qnlYtPHBk#X&2}r7`@K`J@^e~Qm?iRJ*tbAaZDZTmB&mWMkZp7Kj7^kth#_uX z5z>gC(8Xz|Ie(+#&wiF3;Aey|Db(R*-U)!6;l_5@u?-$>j0SgEl5+c}Lfe-$p-dFH zB_$bC<)x6#A_2Uuo8=^l1@}vK!gvbF#b&MoH8ac3xMxUz$LFb8KU(x$YhtHanM_sw zYOFMBX2iNNSe&a}!;G9nv(tsW4@%3iQcqczOCF*JOBQ@4Orw=o?_vc(9$hfO`>U6& zyY_CUa9pASiJpmv`@oR!k;&$`h8!)$uS=}d-fPddfIdMDUW@%3y1LI(1Q=e$)sz(QC*E;Nfl99YTgk+|@jl`+iF?<_D?4YqV0Zl)lO8YWC@1ZWW^mi{5ePQN<~FQ2NMG$|K{py5akJa zkezmqhN)>MGMp$7=sOo2(7ppv``dCIwf&MaQQis7S596kkiw8Do(jO?EY4iJ4Hec6 z4Hymzu`w)cI9Pbq6GPtTP)x&Lmk;FT=ZCB4>(5}c0?;2l`p&?>&<;2(P8a3lOTNP# zdEzF5qDpkRR&PZC&cS{7xD@qV;(g5X%xI?m$9Q + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Purchase order line hide tax in report

+ +

Alpha License: LGPL-3 OCA/purchase-reporting Translate me on Weblate Try me on Runboat

+

Hide taxes column in the purchase order document that is sent to the +vendor.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Use Cases / Context

+

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.

+

This might be event more annoying when there’s tax exemptions like in EU +intracomunitary operations.

+
+
+

Usage

+

Whenever the taxes are in the same group for the whole order the column +won’t be displayed in the purchase order printed report.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Moduon
  • +
+
+
+

Contributors

+
    +
  • David Vidal (Moduon <https://www.moduon.team/>__)
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainers:

+

chienandalu rafaelbn

+

This module is part of the OCA/purchase-reporting project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + From c823cd7754e8de6579709214bcd5a842af2ecb74 Mon Sep 17 00:00:00 2001 From: mymage Date: Wed, 10 Dec 2025 08:57:44 +0000 Subject: [PATCH 2/6] Added translation using Weblate (Italian) --- purchase_order_report_hide_tax/i18n/it.po | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 purchase_order_report_hide_tax/i18n/it.po diff --git a/purchase_order_report_hide_tax/i18n/it.po b/purchase_order_report_hide_tax/i18n/it.po new file mode 100644 index 00000000..9a35050d --- /dev/null +++ b/purchase_order_report_hide_tax/i18n/it.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_order_report_hide_tax +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-12-10 11:43+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.10.4\n" + +#. module: purchase_order_report_hide_tax +#: model:ir.model,name:purchase_order_report_hide_tax.model_purchase_order +msgid "Purchase Order" +msgstr "Ordine di acquisto" + +#. module: purchase_order_report_hide_tax +#: model:ir.model.fields,field_description:purchase_order_report_hide_tax.field_purchase_order__show_tax_column_in_report +msgid "Show Tax Column In Report" +msgstr "Visualizza colonna imposta nel resoconto" From 5c3cb971e035676b28d2c8cf2271ddf3202a3083 Mon Sep 17 00:00:00 2001 From: Aungkokolin1997 Date: Tue, 27 Jan 2026 07:37:09 +0000 Subject: [PATCH 3/6] [IMP] purchase_order_report_hide_tax: pre-commit execution --- purchase_order_report_hide_tax/pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 purchase_order_report_hide_tax/pyproject.toml diff --git a/purchase_order_report_hide_tax/pyproject.toml b/purchase_order_report_hide_tax/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/purchase_order_report_hide_tax/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" From a3c2fd5f5be3e22817408fe945450e6abebc6cbf Mon Sep 17 00:00:00 2001 From: Aungkokolin1997 Date: Tue, 27 Jan 2026 07:37:09 +0000 Subject: [PATCH 4/6] [MIG] purchase_order_report_hide_tax: Migration to 18.0 --- purchase_order_report_hide_tax/__manifest__.py | 2 +- .../reports/purchase_order_report_template.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/purchase_order_report_hide_tax/__manifest__.py b/purchase_order_report_hide_tax/__manifest__.py index 1c01b1d0..2b0584e9 100644 --- a/purchase_order_report_hide_tax/__manifest__.py +++ b/purchase_order_report_hide_tax/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Purchase order line hide tax in report", "summary": "Hide taxes column when they don't add value", - "version": "16.0.1.0.2", + "version": "18.0.1.0.0", "development_status": "Alpha", "category": "Purchases", "website": "https://github.com/OCA/purchase-reporting", diff --git a/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml b/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml index a2ff8137..9fff0c03 100644 --- a/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml +++ b/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml @@ -7,7 +7,7 @@ o.show_tax_column_in_report - + o.show_tax_column_in_report From 2713b4972be5df7bb9a1bd934eee8a260dd377fa Mon Sep 17 00:00:00 2001 From: Aungkokolin1997 Date: Tue, 27 Jan 2026 09:01:40 +0000 Subject: [PATCH 5/6] [IMP] purchase_order_report_hide_tax: add option in tax group to force showing tax column --- purchase_order_report_hide_tax/README.rst | 27 ++++++-- .../__manifest__.py | 3 +- .../i18n/purchase_order_report_hide_tax.pot | 19 +++++- .../models/__init__.py | 1 + .../models/account_tax_group.py | 13 ++++ .../models/purchase_order.py | 2 + .../readme/CONFIGURE.md | 8 +++ .../readme/CONTRIBUTORS.md | 2 + .../purchase_order_report_template.xml | 5 +- .../static/description/index.html | 49 ++++++++----- .../tests/__init__.py | 1 + .../test_purchase_order_report_hide_tax.py | 68 +++++++++++++++++++ .../views/account_tax_group_views.xml | 33 +++++++++ 13 files changed, 206 insertions(+), 25 deletions(-) create mode 100644 purchase_order_report_hide_tax/models/account_tax_group.py create mode 100644 purchase_order_report_hide_tax/readme/CONFIGURE.md create mode 100644 purchase_order_report_hide_tax/tests/__init__.py create mode 100644 purchase_order_report_hide_tax/tests/test_purchase_order_report_hide_tax.py create mode 100644 purchase_order_report_hide_tax/views/account_tax_group_views.xml diff --git a/purchase_order_report_hide_tax/README.rst b/purchase_order_report_hide_tax/README.rst index 7c850276..94c46fd0 100644 --- a/purchase_order_report_hide_tax/README.rst +++ b/purchase_order_report_hide_tax/README.rst @@ -11,7 +11,7 @@ Purchase order line hide tax in report !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:f61cb085cd5bdeb94a2f6d0b87d1f3484aa8a7c697c8c1980812b10288a24446 + !! source digest: sha256:19b21bcfef4f75e08d008398f16bcfdcefc2a25142161b831715bcf63813a91e !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png @@ -21,13 +21,13 @@ Purchase order line hide tax in report :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--reporting-lightgray.png?logo=github - :target: https://github.com/OCA/purchase-reporting/tree/16.0/purchase_order_report_hide_tax + :target: https://github.com/OCA/purchase-reporting/tree/18.0/purchase_order_report_hide_tax :alt: OCA/purchase-reporting .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/purchase-reporting-16-0/purchase-reporting-16-0-purchase_order_report_hide_tax + :target: https://translation.odoo-community.org/projects/purchase-reporting-18-0/purchase-reporting-18-0-purchase_order_report_hide_tax :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-reporting&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-reporting&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -55,6 +55,18 @@ other columns might take. This might be event more annoying when there's tax exemptions like in EU intracomunitary operations. +Configuration +============= + +You can choose to always show the **Taxes** column in the Purchase Order +reports when the taxes on the document belong to certain tax groups +(e.g. domestic transactions). To do so: + +- Go to *Invoicing/Accounting > Configuration > Tax Groups*. +- Enable **Show Tax Column in Purchase Report**: If enabled, the + **Taxes** column will always be shown on the Purchase Order report for + this tax group, even when all order lines share the same taxes. + Usage ===== @@ -67,7 +79,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -83,6 +95,9 @@ Contributors ------------ - David Vidal (``Moduon ``\ \_\_) +- `Quartile `__: + + - Aung Ko Ko Lin Maintainers ----------- @@ -108,6 +123,6 @@ Current `maintainers `__: |maintainer-chienandalu| |maintainer-rafaelbn| -This module is part of the `OCA/purchase-reporting `_ project on GitHub. +This module is part of the `OCA/purchase-reporting `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/purchase_order_report_hide_tax/__manifest__.py b/purchase_order_report_hide_tax/__manifest__.py index 2b0584e9..d4f58920 100644 --- a/purchase_order_report_hide_tax/__manifest__.py +++ b/purchase_order_report_hide_tax/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Purchase order line hide tax in report", "summary": "Hide taxes column when they don't add value", - "version": "18.0.1.0.0", + "version": "18.0.1.0.1", "development_status": "Alpha", "category": "Purchases", "website": "https://github.com/OCA/purchase-reporting", @@ -13,5 +13,6 @@ "depends": ["purchase"], "data": [ "reports/purchase_order_report_template.xml", + "views/account_tax_group_views.xml", ], } diff --git a/purchase_order_report_hide_tax/i18n/purchase_order_report_hide_tax.pot b/purchase_order_report_hide_tax/i18n/purchase_order_report_hide_tax.pot index 9665d8f2..0c6bb07f 100644 --- a/purchase_order_report_hide_tax/i18n/purchase_order_report_hide_tax.pot +++ b/purchase_order_report_hide_tax/i18n/purchase_order_report_hide_tax.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 16.0\n" +"Project-Id-Version: Odoo Server 18.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -13,12 +13,29 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: purchase_order_report_hide_tax +#: model:ir.model.fields,help:purchase_order_report_hide_tax.field_account_tax_group__show_tax_column_in_purchase_report +msgid "" +"If enabled, always show the Taxes column on the Purchase Order report for " +"this tax group even when all lines in the order share the same taxes." +msgstr "" + #. module: purchase_order_report_hide_tax #: model:ir.model,name:purchase_order_report_hide_tax.model_purchase_order msgid "Purchase Order" msgstr "" +#. module: purchase_order_report_hide_tax +#: model:ir.model.fields,field_description:purchase_order_report_hide_tax.field_account_tax_group__show_tax_column_in_purchase_report +msgid "Show Tax Column In Purchase Report" +msgstr "" + #. module: purchase_order_report_hide_tax #: model:ir.model.fields,field_description:purchase_order_report_hide_tax.field_purchase_order__show_tax_column_in_report msgid "Show Tax Column In Report" msgstr "" + +#. module: purchase_order_report_hide_tax +#: model:ir.model,name:purchase_order_report_hide_tax.model_account_tax_group +msgid "Tax Group" +msgstr "" diff --git a/purchase_order_report_hide_tax/models/__init__.py b/purchase_order_report_hide_tax/models/__init__.py index 9f035306..76ca2a0b 100644 --- a/purchase_order_report_hide_tax/models/__init__.py +++ b/purchase_order_report_hide_tax/models/__init__.py @@ -1 +1,2 @@ +from . import account_tax_group from . import purchase_order diff --git a/purchase_order_report_hide_tax/models/account_tax_group.py b/purchase_order_report_hide_tax/models/account_tax_group.py new file mode 100644 index 00000000..839a9f72 --- /dev/null +++ b/purchase_order_report_hide_tax/models/account_tax_group.py @@ -0,0 +1,13 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) + +from odoo import fields, models + + +class AccountTaxGroup(models.Model): + _inherit = "account.tax.group" + + show_tax_column_in_purchase_report = fields.Boolean( + help="If enabled, always show the Taxes column on the Purchase Order report " + "for this tax group even when all lines in the order share the same taxes." + ) diff --git a/purchase_order_report_hide_tax/models/purchase_order.py b/purchase_order_report_hide_tax/models/purchase_order.py index d04de050..f5d88e5f 100644 --- a/purchase_order_report_hide_tax/models/purchase_order.py +++ b/purchase_order_report_hide_tax/models/purchase_order.py @@ -16,6 +16,8 @@ def _compute_show_tax_column_in_report(self): order_lines = order.order_line.filtered(lambda x: not x.display_type) # Can be a recordset if several taxes apply first_line_tax_group = fields.first(order_lines).taxes_id.tax_group_id + if first_line_tax_group.filtered("show_tax_column_in_purchase_report"): + continue # Mixed group taxes, let's show them for clarity order.show_tax_column_in_report = ( first_line_tax_group != order_lines.taxes_id.tax_group_id diff --git a/purchase_order_report_hide_tax/readme/CONFIGURE.md b/purchase_order_report_hide_tax/readme/CONFIGURE.md new file mode 100644 index 00000000..342c50e7 --- /dev/null +++ b/purchase_order_report_hide_tax/readme/CONFIGURE.md @@ -0,0 +1,8 @@ +You can choose to always show the **Taxes** column in the Purchase Order reports +when the taxes on the document belong to certain tax groups (e.g. domestic transactions). +To do so: + +- Go to *Invoicing/Accounting > Configuration > Tax Groups*. +- Enable **Show Tax Column in Purchase Report**: If enabled, the **Taxes** + column will always be shown on the Purchase Order report for this tax group, + even when all order lines share the same taxes. diff --git a/purchase_order_report_hide_tax/readme/CONTRIBUTORS.md b/purchase_order_report_hide_tax/readme/CONTRIBUTORS.md index 05262c2b..4f2d2d2c 100644 --- a/purchase_order_report_hide_tax/readme/CONTRIBUTORS.md +++ b/purchase_order_report_hide_tax/readme/CONTRIBUTORS.md @@ -1 +1,3 @@ * David Vidal (`Moduon `__) +* [Quartile](https://www.quartile.co): + * Aung Ko Ko Lin diff --git a/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml b/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml index 9fff0c03..51864fd5 100644 --- a/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml +++ b/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml @@ -7,7 +7,10 @@ o.show_tax_column_in_report - + o.show_tax_column_in_report diff --git a/purchase_order_report_hide_tax/static/description/index.html b/purchase_order_report_hide_tax/static/description/index.html index 7b823f8b..ddc419fa 100644 --- a/purchase_order_report_hide_tax/static/description/index.html +++ b/purchase_order_report_hide_tax/static/description/index.html @@ -372,9 +372,9 @@

Purchase order line hide tax in report

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:f61cb085cd5bdeb94a2f6d0b87d1f3484aa8a7c697c8c1980812b10288a24446 +!! source digest: sha256:19b21bcfef4f75e08d008398f16bcfdcefc2a25142161b831715bcf63813a91e !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Alpha License: LGPL-3 OCA/purchase-reporting Translate me on Weblate Try me on Runboat

+

Alpha License: LGPL-3 OCA/purchase-reporting Translate me on Weblate Try me on Runboat

Hide taxes column in the purchase order document that is sent to the vendor.

@@ -387,12 +387,13 @@

Purchase order line hide tax in report

+
+

Configuration

+

You can choose to always show the Taxes column in the Purchase Order +reports when the taxes on the document belong to certain tax groups +(e.g. domestic transactions). To do so:

+
    +
  • Go to Invoicing/Accounting > Configuration > Tax Groups.
  • +
  • Enable Show Tax Column in Purchase Report: If enabled, the +Taxes column will always be shown on the Purchase Order report for +this tax group, even when all order lines share the same taxes.
  • +
+
-

Usage

+

Usage

Whenever the taxes are in the same group for the whole order the column won’t be displayed in the purchase order printed report.

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Moduon
-

Contributors

+

Contributors

  • David Vidal (Moduon <https://www.moduon.team/>__)
  • +
  • Quartile:
      +
    • Aung Ko Ko Lin
    • +
    +
-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -443,7 +460,7 @@

Maintainers

promote its widespread use.

Current maintainers:

chienandalu rafaelbn

-

This module is part of the OCA/purchase-reporting project on GitHub.

+

This module is part of the OCA/purchase-reporting project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/purchase_order_report_hide_tax/tests/__init__.py b/purchase_order_report_hide_tax/tests/__init__.py new file mode 100644 index 00000000..abc264f2 --- /dev/null +++ b/purchase_order_report_hide_tax/tests/__init__.py @@ -0,0 +1 @@ +from . import test_purchase_order_report_hide_tax diff --git a/purchase_order_report_hide_tax/tests/test_purchase_order_report_hide_tax.py b/purchase_order_report_hide_tax/tests/test_purchase_order_report_hide_tax.py new file mode 100644 index 00000000..c4970de4 --- /dev/null +++ b/purchase_order_report_hide_tax/tests/test_purchase_order_report_hide_tax.py @@ -0,0 +1,68 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) + +from odoo.fields import Command + +from odoo.addons.base.tests.common import BaseCommon + + +class TestPurchaseOrderReportHideTax(BaseCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.vendor = cls.env["res.partner"].create({"name": "Test Vendor"}) + cls.product = cls.env["product.product"].create({"name": "Test Product"}) + cls.tax_group_10 = cls.env["account.tax.group"].create({"name": "Tax 10%"}) + cls.tax_group_15 = cls.env["account.tax.group"].create({"name": "Tax 15%"}) + cls.tax_10 = cls.env["account.tax"].create( + { + "name": "TEST 10%", + "type_tax_use": "purchase", + "amount_type": "percent", + "amount": 10.00, + "tax_group_id": cls.tax_group_10.id, + } + ) + cls.tax_15 = cls.env["account.tax"].create( + { + "name": "TEST 15%", + "type_tax_use": "purchase", + "amount_type": "percent", + "amount": 15.00, + "tax_group_id": cls.tax_group_15.id, + } + ) + + def _create_po(self, taxes_per_line): + return self.env["purchase.order"].create( + { + "partner_id": self.vendor.id, + "order_line": [ + Command.create( + { + "name": self.product.name, + "product_id": self.product.id, + "product_qty": 1.0, + "price_unit": 100.0, + "taxes_id": [Command.link(taxes.id)], + } + ) + for taxes in taxes_per_line + ], + } + ) + + def test_show_tax_column_in_report(self): + po = self._create_po([self.tax_10, self.tax_10]) + po._compute_show_tax_column_in_report() + self.assertFalse(po.show_tax_column_in_report) + # Mixed tax groups (10% + 15%) -> should show it (True) + po = self._create_po([self.tax_10, self.tax_15]) + po._compute_show_tax_column_in_report() + self.assertTrue(po.show_tax_column_in_report) + + def test_show_tax_column_in_report_by_tax_group_setting(self): + self.tax_group_10.show_tax_column_in_purchase_report = True + po = self._create_po([self.tax_10, self.tax_10]) + po._compute_show_tax_column_in_report() + self.assertTrue(po.show_tax_column_in_report) diff --git a/purchase_order_report_hide_tax/views/account_tax_group_views.xml b/purchase_order_report_hide_tax/views/account_tax_group_views.xml new file mode 100644 index 00000000..518a242b --- /dev/null +++ b/purchase_order_report_hide_tax/views/account_tax_group_views.xml @@ -0,0 +1,33 @@ + + + + account.tax.group.list.inherit + account.tax.group + + + + + + + + + account.tax.group.form.inherit + account.tax.group + + + + + + + + From 86acde456e63e8ed3f00b3cde68983fabc0d78bf Mon Sep 17 00:00:00 2001 From: David Vidal Date: Wed, 13 May 2026 16:30:14 +0200 Subject: [PATCH 6/6] [MIG] purchase_order_report_hide_tax: Migration to 19.0 MT-14669 --- purchase_order_report_hide_tax/README.rst | 10 +++++----- purchase_order_report_hide_tax/__manifest__.py | 2 +- .../models/purchase_order.py | 6 ++++-- .../reports/purchase_order_report_template.xml | 2 +- .../static/description/index.html | 6 +++--- .../tests/test_purchase_order_report_hide_tax.py | 5 ++--- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/purchase_order_report_hide_tax/README.rst b/purchase_order_report_hide_tax/README.rst index 94c46fd0..dbab2375 100644 --- a/purchase_order_report_hide_tax/README.rst +++ b/purchase_order_report_hide_tax/README.rst @@ -21,13 +21,13 @@ Purchase order line hide tax in report :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--reporting-lightgray.png?logo=github - :target: https://github.com/OCA/purchase-reporting/tree/18.0/purchase_order_report_hide_tax + :target: https://github.com/OCA/purchase-reporting/tree/19.0/purchase_order_report_hide_tax :alt: OCA/purchase-reporting .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/purchase-reporting-18-0/purchase-reporting-18-0-purchase_order_report_hide_tax + :target: https://translation.odoo-community.org/projects/purchase-reporting-19-0/purchase-reporting-19-0-purchase_order_report_hide_tax :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-reporting&target_branch=18.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-reporting&target_branch=19.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -79,7 +79,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -123,6 +123,6 @@ Current `maintainers `__: |maintainer-chienandalu| |maintainer-rafaelbn| -This module is part of the `OCA/purchase-reporting `_ project on GitHub. +This module is part of the `OCA/purchase-reporting `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/purchase_order_report_hide_tax/__manifest__.py b/purchase_order_report_hide_tax/__manifest__.py index d4f58920..38bc9612 100644 --- a/purchase_order_report_hide_tax/__manifest__.py +++ b/purchase_order_report_hide_tax/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Purchase order line hide tax in report", "summary": "Hide taxes column when they don't add value", - "version": "18.0.1.0.1", + "version": "19.0.1.0.0", "development_status": "Alpha", "category": "Purchases", "website": "https://github.com/OCA/purchase-reporting", diff --git a/purchase_order_report_hide_tax/models/purchase_order.py b/purchase_order_report_hide_tax/models/purchase_order.py index f5d88e5f..e2368d72 100644 --- a/purchase_order_report_hide_tax/models/purchase_order.py +++ b/purchase_order_report_hide_tax/models/purchase_order.py @@ -15,10 +15,12 @@ def _compute_show_tax_column_in_report(self): for order in self.filtered("order_line"): order_lines = order.order_line.filtered(lambda x: not x.display_type) # Can be a recordset if several taxes apply - first_line_tax_group = fields.first(order_lines).taxes_id.tax_group_id + first_line_tax_group = next( + iter(order_lines), order_lines + ).tax_ids.tax_group_id if first_line_tax_group.filtered("show_tax_column_in_purchase_report"): continue # Mixed group taxes, let's show them for clarity order.show_tax_column_in_report = ( - first_line_tax_group != order_lines.taxes_id.tax_group_id + first_line_tax_group != order_lines.tax_ids.tax_group_id ) diff --git a/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml b/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml index 51864fd5..dbaf1c09 100644 --- a/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml +++ b/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml @@ -8,7 +8,7 @@ o.show_tax_column_in_report o.show_tax_column_in_report diff --git a/purchase_order_report_hide_tax/static/description/index.html b/purchase_order_report_hide_tax/static/description/index.html index ddc419fa..25674aaf 100644 --- a/purchase_order_report_hide_tax/static/description/index.html +++ b/purchase_order_report_hide_tax/static/description/index.html @@ -374,7 +374,7 @@

Purchase order line hide tax in report

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:19b21bcfef4f75e08d008398f16bcfdcefc2a25142161b831715bcf63813a91e !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Alpha License: LGPL-3 OCA/purchase-reporting Translate me on Weblate Try me on Runboat

+

Alpha License: LGPL-3 OCA/purchase-reporting Translate me on Weblate Try me on Runboat

Hide taxes column in the purchase order document that is sent to the vendor.

@@ -428,7 +428,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -460,7 +460,7 @@

Maintainers

promote its widespread use.

Current maintainers:

chienandalu rafaelbn

-

This module is part of the OCA/purchase-reporting project on GitHub.

+

This module is part of the OCA/purchase-reporting project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/purchase_order_report_hide_tax/tests/test_purchase_order_report_hide_tax.py b/purchase_order_report_hide_tax/tests/test_purchase_order_report_hide_tax.py index c4970de4..69ce88f7 100644 --- a/purchase_order_report_hide_tax/tests/test_purchase_order_report_hide_tax.py +++ b/purchase_order_report_hide_tax/tests/test_purchase_order_report_hide_tax.py @@ -10,7 +10,6 @@ class TestPurchaseOrderReportHideTax(BaseCommon): @classmethod def setUpClass(cls): super().setUpClass() - cls.vendor = cls.env["res.partner"].create({"name": "Test Vendor"}) cls.product = cls.env["product.product"].create({"name": "Test Product"}) cls.tax_group_10 = cls.env["account.tax.group"].create({"name": "Tax 10%"}) cls.tax_group_15 = cls.env["account.tax.group"].create({"name": "Tax 15%"}) @@ -36,7 +35,7 @@ def setUpClass(cls): def _create_po(self, taxes_per_line): return self.env["purchase.order"].create( { - "partner_id": self.vendor.id, + "partner_id": self.partner.id, "order_line": [ Command.create( { @@ -44,7 +43,7 @@ def _create_po(self, taxes_per_line): "product_id": self.product.id, "product_qty": 1.0, "price_unit": 100.0, - "taxes_id": [Command.link(taxes.id)], + "tax_ids": [Command.link(taxes.id)], } ) for taxes in taxes_per_line