diff --git a/stock_picking_report_delivery_custom_name/README.rst b/stock_picking_report_delivery_custom_name/README.rst new file mode 100644 index 000000000..9844a25d5 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/README.rst @@ -0,0 +1,133 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +================================ +Hidden product names in pickings +================================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:f0badbbbeb097457171667cf21dcf5c251d284f75a573f5a79cd2d7c8131f979 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fstock--logistics--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-reporting/tree/19.0/stock_picking_report_delivery_custom_name + :alt: OCA/stock-logistics-reporting +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-reporting-19-0/stock-logistics-reporting-19-0-stock_picking_report_delivery_custom_name + :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/stock-logistics-reporting&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +When you install this module the product name will be hidden from the +delivery slip report whenever a description is set in the operation or +the detailed operation. + +.. 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 +=================== + +In some bussinesses even the internal references used in the product are +considered strategic information that should be kept secret. + +Configuration +============= + +In order to set a default picking description: + +- Go to *Inventory > Products \* Products* and chose the one you want. +- Click on the *Inventory* tab and go to the *Description for Delivery + orders* field. +- Set the text you want your customers to see. + +You can also use this module along with +``stock_picking_report_custom_description`` in order to get the +descriptions from the sales directly. + +Usage +===== + +To test this module, you can first configure the products with their +puclic descriptions or set them in the picking operations. + +- Go to *Inventory > Overview* and click in the *Delivery orders* orders + to process. +- Choose one and in the *Operations* tab, use the columns selector to + reveal the **Description** one. +- You can edit with the text you want to in the lines you want to. +- Print the delivery slip from the print menu in the header. +- You'll see just the description where you set it. + +Known issues / Roadmap +====================== + +- Allow to add exceptions at product level (a simple flag would do) to + allow to keep the standard behavior in some exceptions. + +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 + +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-Andrii9090| image:: https://github.com/Andrii9090.png?size=40px + :target: https://github.com/Andrii9090 + :alt: Andrii9090 + +Current `maintainers `__: + +|maintainer-chienandalu| |maintainer-Andrii9090| + +This module is part of the `OCA/stock-logistics-reporting `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_picking_report_delivery_custom_name/__init__.py b/stock_picking_report_delivery_custom_name/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/stock_picking_report_delivery_custom_name/__manifest__.py b/stock_picking_report_delivery_custom_name/__manifest__.py new file mode 100644 index 000000000..d2e71ced9 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2023 Moduon Team S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) + +{ + "name": "Hidden product names in pickings", + "summary": """ + Allows to hide the product display name in favor of the picking description""", + "version": "19.0.1.0.0", + "development_status": "Alpha", + "category": "Inventory/Delivery", + "website": "https://github.com/OCA/stock-logistics-reporting", + "author": "Moduon, Odoo Community Association (OCA)", + "maintainers": ["chienandalu", "Andrii9090"], + "license": "LGPL-3", + "depends": [ + "stock", + ], + "data": [ + "views/report_deliveryslip.xml", + ], +} diff --git a/stock_picking_report_delivery_custom_name/i18n/it.po b/stock_picking_report_delivery_custom_name/i18n/it.po new file mode 100644 index 000000000..73388557f --- /dev/null +++ b/stock_picking_report_delivery_custom_name/i18n/it.po @@ -0,0 +1,14 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\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" diff --git a/stock_picking_report_delivery_custom_name/i18n/stock_picking_report_delivery_custom_name.pot b/stock_picking_report_delivery_custom_name/i18n/stock_picking_report_delivery_custom_name.pot new file mode 100644 index 000000000..78d58d53f --- /dev/null +++ b/stock_picking_report_delivery_custom_name/i18n/stock_picking_report_delivery_custom_name.pot @@ -0,0 +1,13 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +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" diff --git a/stock_picking_report_delivery_custom_name/pyproject.toml b/stock_picking_report_delivery_custom_name/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/stock_picking_report_delivery_custom_name/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/stock_picking_report_delivery_custom_name/readme/CONFIGURE.md b/stock_picking_report_delivery_custom_name/readme/CONFIGURE.md new file mode 100644 index 000000000..9ee725860 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/readme/CONFIGURE.md @@ -0,0 +1,8 @@ +In order to set a default picking description: + +- Go to *Inventory > Products * Products* and chose the one you want. +- Click on the *Inventory* tab and go to the *Description for Delivery orders* field. +- Set the text you want your customers to see. + +You can also use this module along with `stock_picking_report_custom_description` in +order to get the descriptions from the sales directly. diff --git a/stock_picking_report_delivery_custom_name/readme/CONTEXT.md b/stock_picking_report_delivery_custom_name/readme/CONTEXT.md new file mode 100644 index 000000000..eeb676883 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/readme/CONTEXT.md @@ -0,0 +1,2 @@ +In some bussinesses even the internal references used in the product are considered +strategic information that should be kept secret. diff --git a/stock_picking_report_delivery_custom_name/readme/DESCRIPTION.md b/stock_picking_report_delivery_custom_name/readme/DESCRIPTION.md new file mode 100644 index 000000000..dd8f3617e --- /dev/null +++ b/stock_picking_report_delivery_custom_name/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +When you install this module the product name will be hidden from the delivery slip +report whenever a description is set in the operation or the detailed operation. diff --git a/stock_picking_report_delivery_custom_name/readme/ROADMAP.md b/stock_picking_report_delivery_custom_name/readme/ROADMAP.md new file mode 100644 index 000000000..3760f78b3 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/readme/ROADMAP.md @@ -0,0 +1,2 @@ +- Allow to add exceptions at product level (a simple flag would do) to allow to keep the + standard behavior in some exceptions. diff --git a/stock_picking_report_delivery_custom_name/readme/USAGE.md b/stock_picking_report_delivery_custom_name/readme/USAGE.md new file mode 100644 index 000000000..af1030282 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/readme/USAGE.md @@ -0,0 +1,9 @@ +To test this module, you can first configure the products with their puclic descriptions +or set them in the picking operations. + +- Go to *Inventory > Overview* and click in the *Delivery orders* orders to process. +- Choose one and in the *Operations* tab, use the columns selector to reveal the + **Description** one. +- You can edit with the text you want to in the lines you want to. +- Print the delivery slip from the print menu in the header. +- You'll see just the description where you set it. diff --git a/stock_picking_report_delivery_custom_name/static/description/icon.png b/stock_picking_report_delivery_custom_name/static/description/icon.png new file mode 100644 index 000000000..1dcc49c24 Binary files /dev/null and b/stock_picking_report_delivery_custom_name/static/description/icon.png differ diff --git a/stock_picking_report_delivery_custom_name/static/description/index.html b/stock_picking_report_delivery_custom_name/static/description/index.html new file mode 100644 index 000000000..048ddf7d5 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/static/description/index.html @@ -0,0 +1,475 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Hidden product names in pickings

+ +

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

+

When you install this module the product name will be hidden from the +delivery slip report whenever a description is set in the operation or +the detailed operation.

+
+

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

+

In some bussinesses even the internal references used in the product are +considered strategic information that should be kept secret.

+
+
+

Configuration

+

In order to set a default picking description:

+
    +
  • Go to Inventory > Products * Products and chose the one you want.
  • +
  • Click on the Inventory tab and go to the Description for Delivery +orders field.
  • +
  • Set the text you want your customers to see.
  • +
+

You can also use this module along with +stock_picking_report_custom_description in order to get the +descriptions from the sales directly.

+
+
+

Usage

+

To test this module, you can first configure the products with their +puclic descriptions or set them in the picking operations.

+
    +
  • Go to Inventory > Overview and click in the Delivery orders orders +to process.
  • +
  • Choose one and in the Operations tab, use the columns selector to +reveal the Description one.
  • +
  • You can edit with the text you want to in the lines you want to.
  • +
  • Print the delivery slip from the print menu in the header.
  • +
  • You’ll see just the description where you set it.
  • +
+
+
+

Known issues / Roadmap

+
    +
  • Allow to add exceptions at product level (a simple flag would do) to +allow to keep the standard behavior in some exceptions.
  • +
+
+
+

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
  • +
+
+
+

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 Andrii9090

+

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

+

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

+
+
+
+
+ + diff --git a/stock_picking_report_delivery_custom_name/tests/__init__.py b/stock_picking_report_delivery_custom_name/tests/__init__.py new file mode 100644 index 000000000..8b887e347 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/tests/__init__.py @@ -0,0 +1 @@ +from . import test_delivery_slip_custom_name diff --git a/stock_picking_report_delivery_custom_name/tests/test_delivery_slip_custom_name.py b/stock_picking_report_delivery_custom_name/tests/test_delivery_slip_custom_name.py new file mode 100644 index 000000000..a8fbe1692 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/tests/test_delivery_slip_custom_name.py @@ -0,0 +1,60 @@ +# Copyright 2023 Moduon Team S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) +from odoo.tests import Form +from odoo.tools import html2plaintext + +from odoo.addons.base.tests.common import BaseCommon + + +class TestStockPickingReportCustomName(BaseCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.product = cls.env["product.product"].create( + { + "name": "Super secret part name", + "default_code": "SPN", + "type": "consu", + "description_pickingout": "Generic part public name", + } + ) + cls.delivery_type = cls.env.ref("stock.picking_type_out") + picking_form = Form(cls.env["stock.picking"]) + picking_form.picking_type_id = cls.env.ref("stock.picking_type_out") + with picking_form.move_ids.new() as move_form: + move_form.product_id = cls.product + move_form.product_uom_qty = 1 + move_form.quantity = 1 + cls.picking = picking_form.save() + + def _get_report_in_plain_text(self): + html, _ = self.env["ir.actions.report"]._render_qweb_html( + "stock.action_report_delivery", self.picking.ids + ) + return html2plaintext(html) + + def test_delivery_slip_with_public_name(self): + text = self._get_report_in_plain_text() + self.assertTrue("Generic part public name" in text) + self.assertFalse("Super secret part name" in text) + self.picking.button_validate() + # Now we're seeing detailed operations + text = self._get_report_in_plain_text() + self.assertTrue("Generic part public name" in text) + self.assertFalse("Super secret part name" in text) + + def test_delivery_slip_with_regular_name(self): + self.picking.move_ids.description_picking = False + text = self._get_report_in_plain_text() + self.assertFalse("Generic part public name" in text) + self.assertTrue("[SPN] Super secret part name" in text) + # The description is ignored as it's equal to the product name + self.picking.move_ids.description_picking = "Super secret part name" + text = self._get_report_in_plain_text() + self.assertFalse("Generic part public name" in text) + self.assertTrue("[SPN] Super secret part name" in text) + self.assertEqual( + 1, + text.count("Super secret part name"), + "The name should be printed just once!", + ) diff --git a/stock_picking_report_delivery_custom_name/views/report_deliveryslip.xml b/stock_picking_report_delivery_custom_name/views/report_deliveryslip.xml new file mode 100644 index 000000000..aeacf48a3 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/views/report_deliveryslip.xml @@ -0,0 +1,49 @@ + + + + + + +