diff --git a/purchase_order_report_hide_tax/README.rst b/purchase_order_report_hide_tax/README.rst new file mode 100644 index 00000000..dbab2375 --- /dev/null +++ b/purchase_order_report_hide_tax/README.rst @@ -0,0 +1,128 @@ +.. 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:19b21bcfef4f75e08d008398f16bcfdcefc2a25142161b831715bcf63813a91e + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/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-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=19.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. + +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 +===== + +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 ``\ \_\_) +- `Quartile `__: + + - Aung Ko Ko Lin + +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..38bc9612 --- /dev/null +++ b/purchase_order_report_hide_tax/__manifest__.py @@ -0,0 +1,18 @@ +# 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": "19.0.1.0.0", + "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", + "views/account_tax_group_views.xml", + ], +} 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" 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..0c6bb07f --- /dev/null +++ b/purchase_order_report_hide_tax/i18n/purchase_order_report_hide_tax.pot @@ -0,0 +1,41 @@ +# 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 18.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.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 new file mode 100644 index 00000000..76ca2a0b --- /dev/null +++ b/purchase_order_report_hide_tax/models/__init__.py @@ -0,0 +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 new file mode 100644 index 00000000..e2368d72 --- /dev/null +++ b/purchase_order_report_hide_tax/models/purchase_order.py @@ -0,0 +1,26 @@ +# 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 = 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.tax_ids.tax_group_id + ) 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" 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/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..4f2d2d2c --- /dev/null +++ b/purchase_order_report_hide_tax/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +* David Vidal (`Moduon `__) +* [Quartile](https://www.quartile.co): + * Aung Ko Ko Lin 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..dbaf1c09 --- /dev/null +++ b/purchase_order_report_hide_tax/reports/purchase_order_report_template.xml @@ -0,0 +1,17 @@ + + + + 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 00000000..1dcc49c2 Binary files /dev/null and b/purchase_order_report_hide_tax/static/description/icon.png differ diff --git a/purchase_order_report_hide_tax/static/description/index.html b/purchase_order_report_hide_tax/static/description/index.html new file mode 100644 index 00000000..25674aaf --- /dev/null +++ b/purchase_order_report_hide_tax/static/description/index.html @@ -0,0 +1,470 @@ + + + + + +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.

+
+
+

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

+

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/>__)
  • +
  • Quartile:
      +
    • Aung Ko Ko Lin
    • +
    +
  • +
+
+
+

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.

+
+
+
+
+ + 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..69ce88f7 --- /dev/null +++ b/purchase_order_report_hide_tax/tests/test_purchase_order_report_hide_tax.py @@ -0,0 +1,67 @@ +# 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.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.partner.id, + "order_line": [ + Command.create( + { + "name": self.product.name, + "product_id": self.product.id, + "product_qty": 1.0, + "price_unit": 100.0, + "tax_ids": [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 + + + + + + + +