Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions purchase_order_report_hide_tax/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
======================================
Purchase order line hide tax in report
======================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c3f8c634c1fae23b76f78082b36599f63225f7b3b09f33d3e5fa90f5b185f557
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/licence-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 <https://odoo-community.org/page/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 <https://github.com/OCA/purchase-reporting/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 <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**>`_.

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.

.. 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 <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-chienandalu| |maintainer-rafaelbn|

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.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions purchase_order_report_hide_tax/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions purchase_order_report_hide_tax/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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.1",
"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",
],
}
1 change: 1 addition & 0 deletions purchase_order_report_hide_tax/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import purchase_order
22 changes: 22 additions & 0 deletions purchase_order_report_hide_tax/models/purchase_order.py
Original file line number Diff line number Diff line change
@@ -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
)
3 changes: 3 additions & 0 deletions purchase_order_report_hide_tax/readme/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions purchase_order_report_hide_tax/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* David Vidal (`Moduon <https://www.moduon.team/>`__)
1 change: 1 addition & 0 deletions purchase_order_report_hide_tax/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hide taxes column in the purchase order document that is sent to the vendor.
2 changes: 2 additions & 0 deletions purchase_order_report_hide_tax/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template
id="report_purchaseorder_document"
inherit_id="purchase.report_purchaseorder_document"
>
<xpath expr="//th[@name='th_taxes']" position="attributes">
<attribute name="t-if">o.show_tax_column_in_report</attribute>
</xpath>
<xpath expr="//td[@name='td_taxes']" position="attributes">
<attribute name="t-if">o.show_tax_column_in_report</attribute>
</xpath>
</template>
</odoo>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading