Skip to content
Open
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
113 changes: 113 additions & 0 deletions sale_order_line_no_print/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
================================
Sale order line hidden in report
================================

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

.. |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%2Fsale--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/sale-workflow/tree/18.0/sale_order_line_no_print
:alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_order_line_no_print
: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/sale-workflow&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to hide some order lines from the reports and portal
views that the final customer has access to.

.. 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
===================

In some ocassions the salesman wants to hide some info that's no
relevant for the customer but that it's needed for other documents
(delivery info, pack items, etc.) as they don't want to disclose some
strategic data to the competence.

Usage
=====

To hide sale lines from the report:

- Go to a sales order/quotation/invoice.
- In the lines, click on the column selector to reveal the *Display in
report* column.
- Toggle it on or off depending on your will.
- Go to the portal view: you won't see those hidden lines.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/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/sale-workflow/issues/new?body=module:%20sale_order_line_no_print%0Aversion:%2018.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/>`__)
- Jairo Llopis (`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/sale-workflow <https://github.com/OCA/sale-workflow/tree/18.0/sale_order_line_no_print>`_ 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 sale_order_line_no_print/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
20 changes: 20 additions & 0 deletions sale_order_line_no_print/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2025 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)
{
"name": "Sale order line hidden in report",
"summary": "Hide order lines in reports",
"version": "18.0.1.0.0",
"development_status": "Alpha",
"category": "Sales/Sales",
"website": "https://github.com/OCA/sale-workflow",
"author": "Moduon, Odoo Community Association (OCA)",
"maintainers": ["chienandalu", "rafaelbn"],
"license": "LGPL-3",
"depends": ["sale"],
"data": [
"views/report_invoice_document.xml",
"views/report_saleorder_document.xml",
"views/account_move_views.xml",
"views/sale_order_views.xml",
],
}
40 changes: 40 additions & 0 deletions sale_order_line_no_print/i18n/sale_order_line_no_print.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_order_line_no_print
#
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: sale_order_line_no_print
#: model:ir.model.fields,help:sale_order_line_no_print.field_account_move_line__display_in_report
msgid "Disable it to hide it in the invoice reports that customer sees"
msgstr ""

#. module: sale_order_line_no_print
#: model:ir.model.fields,help:sale_order_line_no_print.field_sale_order_line__display_in_report
msgid "Disable it to hide it in the quotations/sale orders that customer sees"
msgstr ""

#. module: sale_order_line_no_print
#: model:ir.model.fields,field_description:sale_order_line_no_print.field_account_move_line__display_in_report
#: model:ir.model.fields,field_description:sale_order_line_no_print.field_sale_order_line__display_in_report
msgid "Display In Report"
msgstr ""

#. module: sale_order_line_no_print
#: model:ir.model,name:sale_order_line_no_print.model_account_move_line
msgid "Journal Item"
msgstr ""

#. module: sale_order_line_no_print
#: model:ir.model,name:sale_order_line_no_print.model_sale_order_line
msgid "Sales Order Line"
msgstr ""
2 changes: 2 additions & 0 deletions sale_order_line_no_print/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import account_move
from . import sale_order
20 changes: 20 additions & 0 deletions sale_order_line_no_print/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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 AccountMoveLine(models.Model):
_inherit = "account.move.line"

display_in_report = fields.Boolean(
default=True,
help="Disable it to hide it in the invoice reports that customer sees",
)

def _compute_totals(self):
res = super()._compute_totals()
# Avoid hiding lines with any amount
self.filtered(
lambda line: line.price_total and not line.display_in_report
).display_in_report = True
return res
25 changes: 25 additions & 0 deletions sale_order_line_no_print/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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 SaleOrderLine(models.Model):
_inherit = "sale.order.line"

display_in_report = fields.Boolean(
default=True,
help="Disable it to hide it in the quotations/sale orders that customer sees",
)

def _prepare_invoice_line(self, **optional_values):
res = super()._prepare_invoice_line(**optional_values)
res["display_in_report"] = self.display_in_report
return res

def _compute_amount(self):
res = super()._compute_amount()
# Avoid hiding lines with any amount
self.filtered(
lambda line: line.price_total and not line.display_in_report
).display_in_report = True
return res
3 changes: 3 additions & 0 deletions sale_order_line_no_print/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions sale_order_line_no_print/readme/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
In some ocassions the salesman wants to hide some info that's no relevant for the
customer but that it's needed for other documents (delivery info, pack items, etc.) as
they don't want to disclose some strategic data to the competence.
2 changes: 2 additions & 0 deletions sale_order_line_no_print/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- David Vidal ([Moduon](https://www.moduon.team/))
- Jairo Llopis ([Moduon](https://www.moduon.team/))
2 changes: 2 additions & 0 deletions sale_order_line_no_print/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows to hide some order lines from the reports and portal views
that the final customer has access to.
6 changes: 6 additions & 0 deletions sale_order_line_no_print/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
To hide sale lines from the report:

- Go to a sales order/quotation/invoice.
- In the lines, click on the column selector to reveal the *Display in report* column.
- Toggle it on or off depending on your will.
- Go to the portal view: you won't see those hidden lines.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading