diff --git a/setup/stock_picking_report_custom_description/odoo/addons/stock_picking_report_custom_description b/setup/stock_picking_report_custom_description/odoo/addons/stock_picking_report_custom_description new file mode 120000 index 0000000..fa882a4 --- /dev/null +++ b/setup/stock_picking_report_custom_description/odoo/addons/stock_picking_report_custom_description @@ -0,0 +1 @@ +../../../../stock_picking_report_custom_description \ No newline at end of file diff --git a/setup/stock_picking_report_custom_description/setup.py b/setup/stock_picking_report_custom_description/setup.py new file mode 100644 index 0000000..28c57bb --- /dev/null +++ b/setup/stock_picking_report_custom_description/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_picking_report_custom_description/README.rst b/stock_picking_report_custom_description/README.rst new file mode 100644 index 0000000..82798cb --- /dev/null +++ b/stock_picking_report_custom_description/README.rst @@ -0,0 +1,104 @@ +======================================= +Stock Picking Report Custom Description +======================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:6c03fe3cfe5f5df1c21382b6b7e658d4b8cebecf53d1f5003cbb7817ff40f003 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png + :target: https://odoo-community.org/page/development-status + :alt: Production/Stable +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-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/15.0/stock_picking_report_custom_description + :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-15-0/stock-logistics-reporting-15-0-stock_picking_report_custom_description + :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=15.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module transfers the sales order line description to the picking, and +allows to print such text on the picking reports. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +#. Create a sale order and set manual description in sale order lines. +#. Confirm the order. +#. Navigate to the delivery through the smart-button. +#. You can print the reports with move name instead product name on the specific + reports: + + * Delivery Slip (Description). + * Picking Operations (Description). + +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 +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `_: + + * Carlos Dauden + * Sergio Teruel + * Ernesto Tejeda + * Pilar Vargas + +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-carlosdauden| image:: https://github.com/carlosdauden.png?size=40px + :target: https://github.com/carlosdauden + :alt: carlosdauden + +Current `maintainer `__: + +|maintainer-carlosdauden| + +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_custom_description/__init__.py b/stock_picking_report_custom_description/__init__.py new file mode 100644 index 0000000..02179fb --- /dev/null +++ b/stock_picking_report_custom_description/__init__.py @@ -0,0 +1,2 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import models diff --git a/stock_picking_report_custom_description/__manifest__.py b/stock_picking_report_custom_description/__manifest__.py new file mode 100644 index 0000000..a0a6f6b --- /dev/null +++ b/stock_picking_report_custom_description/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2017 Tecnativa - Carlos Dauden +# Copyright 2018 Tecnativa - Vicent Cubells +# Copyright 2018 Tecnativa - Sergio Teruel +# Copyright 2023 Tecnativa - Carolina Fernandez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Stock Picking Report Custom Description", + "summary": "Show moves description in picking reports", + "version": "16.0.1.0.0", + "category": "Warehouse", + "website": "https://github.com/OCA/stock-logistics-reporting", + "author": "Tecnativa, Odoo Community Association (OCA)", + "development_status": "Production/Stable", + "maintainers": ["carlosdauden"], + "license": "AGPL-3", + "depends": [ + "sale_stock", + ], + "data": [], +} diff --git a/stock_picking_report_custom_description/i18n/es.po b/stock_picking_report_custom_description/i18n/es.po new file mode 100644 index 0000000..2cb3573 --- /dev/null +++ b/stock_picking_report_custom_description/i18n/es.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_report_custom_description +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-12-04 15:34+0000\n" +"PO-Revision-Date: 2019-12-04 16:35+0100\n" +"Last-Translator: Carlos Dauden \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"X-Generator: Poedit 2.0.6\n" + +#. module: stock_picking_report_custom_description +#: model:ir.actions.report,name:stock_picking_report_custom_description.action_report_delivery_description +msgid "Delivery Slip (Description)" +msgstr "Vale de entrega (descripción)" + +#. module: stock_picking_report_custom_description +#: model:ir.actions.report,name:stock_picking_report_custom_description.action_report_picking_description +msgid "Picking Operations (Description)" +msgstr "Operaciones de picking (descripción)" + +#~ msgid "Description" +#~ msgstr "Descripción" + +#~ msgid "Qty" +#~ msgstr "Ctd." + +#~ msgid "Packing Operation" +#~ msgstr "Operación de empaquetado" + +#~ msgid "Several product description" +#~ msgstr "Varias descripciones de producto" diff --git a/stock_picking_report_custom_description/i18n/stock_picking_report_custom_description.pot b/stock_picking_report_custom_description/i18n/stock_picking_report_custom_description.pot new file mode 100644 index 0000000..7c0eeab --- /dev/null +++ b/stock_picking_report_custom_description/i18n/stock_picking_report_custom_description.pot @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_report_custom_description +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.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: stock_picking_report_custom_description +#: model:ir.actions.report,name:stock_picking_report_custom_description.action_report_delivery_description +msgid "Delivery Slip (Description)" +msgstr "" + +#. module: stock_picking_report_custom_description +#: model:ir.actions.report,name:stock_picking_report_custom_description.action_report_picking_description +msgid "Picking Operations (Description)" +msgstr "" + +#. module: stock_picking_report_custom_description +#: model:ir.model,name:stock_picking_report_custom_description.model_stock_rule +msgid "Stock Rule" +msgstr "" diff --git a/stock_picking_report_custom_description/models/__init__.py b/stock_picking_report_custom_description/models/__init__.py new file mode 100644 index 0000000..0745213 --- /dev/null +++ b/stock_picking_report_custom_description/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import stock_rule +from . import sale_order_line diff --git a/stock_picking_report_custom_description/models/sale_order_line.py b/stock_picking_report_custom_description/models/sale_order_line.py new file mode 100644 index 0000000..6883cba --- /dev/null +++ b/stock_picking_report_custom_description/models/sale_order_line.py @@ -0,0 +1,16 @@ +# Copyright 2023 Tecnativa - Carolina Fernandez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class SaleOrderLine(models.Model): + _inherit = "sale.order.line" + + def write(self, vals): + res = super().write(vals) + if vals.get("name"): + moves = self.env["stock.move"].search([("sale_line_id", "=", self.id)]) + if moves: + moves.write({"description_picking": vals["name"]}) + return res diff --git a/stock_picking_report_custom_description/models/stock_rule.py b/stock_picking_report_custom_description/models/stock_rule.py new file mode 100644 index 0000000..0869659 --- /dev/null +++ b/stock_picking_report_custom_description/models/stock_rule.py @@ -0,0 +1,36 @@ +# Copyright 2022 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class StockRule(models.Model): + _inherit = "stock.rule" + + def _get_stock_move_values( + self, + product_id, + product_qty, + product_uom, + location_id, + name, + origin, + company_id, + values, + ): + """Transfer the SO line description to the move name.""" + res = super()._get_stock_move_values( + product_id, + product_qty, + product_uom, + location_id, + name, + origin, + company_id, + values, + ) + if values.get("sale_line_id"): + line = self.env["sale.order.line"].browse(values["sale_line_id"]) + res["description_picking"] = line.name + res["name"] = line.name + return res diff --git a/stock_picking_report_custom_description/readme/CONTRIBUTORS.rst b/stock_picking_report_custom_description/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..82d59ed --- /dev/null +++ b/stock_picking_report_custom_description/readme/CONTRIBUTORS.rst @@ -0,0 +1,7 @@ +* `Tecnativa `_: + + * Carlos Dauden + * Sergio Teruel + * Ernesto Tejeda + * Pilar Vargas + * Carolina Fernandez diff --git a/stock_picking_report_custom_description/readme/DESCRIPTION.rst b/stock_picking_report_custom_description/readme/DESCRIPTION.rst new file mode 100644 index 0000000..d36ec0e --- /dev/null +++ b/stock_picking_report_custom_description/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module transfers the sales order line description to the picking description, and +allows to print such text on the picking reports. +When the sales order line description is changed, picking description is updated. diff --git a/stock_picking_report_custom_description/readme/USAGE.rst b/stock_picking_report_custom_description/readme/USAGE.rst new file mode 100644 index 0000000..2d894a0 --- /dev/null +++ b/stock_picking_report_custom_description/readme/USAGE.rst @@ -0,0 +1,6 @@ +To use this module, you need to: + +#. Create a sale order and set manual description in sale order lines. +#. Confirm the order. +#. Navigate to the delivery through the smart-button. +#. You can check sales order line description is the same as description picking diff --git a/stock_picking_report_custom_description/static/description/icon.png b/stock_picking_report_custom_description/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/stock_picking_report_custom_description/static/description/icon.png differ diff --git a/stock_picking_report_custom_description/static/description/index.html b/stock_picking_report_custom_description/static/description/index.html new file mode 100644 index 0000000..ad9f177 --- /dev/null +++ b/stock_picking_report_custom_description/static/description/index.html @@ -0,0 +1,447 @@ + + + + + + +Stock Picking Report Custom Description + + + +
+

Stock Picking Report Custom Description

+ + +

Production/Stable License: AGPL-3 OCA/stock-logistics-reporting Translate me on Weblate Try me on Runboat

+

This module transfers the sales order line description to the picking, and +allows to print such text on the picking reports.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  1. Create a sale order and set manual description in sale order lines.
  2. +
  3. Confirm the order.
  4. +
  5. Navigate to the delivery through the smart-button.
  6. +
  7. You can print the reports with move name instead product name on the specific +reports:
      +
    • Delivery Slip (Description).
    • +
    • Picking Operations (Description).
    • +
    +
  8. +
+
+
+

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

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+
    +
  • Tecnativa:
      +
    • Carlos Dauden
    • +
    • Sergio Teruel
    • +
    • Ernesto Tejeda
    • +
    • Pilar Vargas
    • +
    • Carolina Fernandez
    • +
    +
  • +
+
+
+

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 maintainer:

+

carlosdauden

+

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_custom_description/tests/__init__.py b/stock_picking_report_custom_description/tests/__init__.py new file mode 100644 index 0000000..21aa35c --- /dev/null +++ b/stock_picking_report_custom_description/tests/__init__.py @@ -0,0 +1,2 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import test_stock_picking_report_custom_description diff --git a/stock_picking_report_custom_description/tests/test_stock_picking_report_custom_description.py b/stock_picking_report_custom_description/tests/test_stock_picking_report_custom_description.py new file mode 100644 index 0000000..f906b29 --- /dev/null +++ b/stock_picking_report_custom_description/tests/test_stock_picking_report_custom_description.py @@ -0,0 +1,32 @@ +# Copyright 2022 Tecnativa - Pedro M. Baeza +# Copyright 2023 Tecnativa - Carolina Fernandez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests import common + + +class TestStockPickingReportCustomDescription(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.customer = cls.env["res.partner"].create({"name": "Test customer"}) + cls.product = cls.env["product.product"].create( + {"name": "Test product", "type": "product"} + ) + order_form = common.Form(cls.env["sale.order"]) + order_form.partner_id = cls.customer + with order_form.order_line.new() as line_form: + line_form.product_id = cls.product + line_form.name = "Custom description" + cls.order = order_form.save() + + def test_so_custom_description_transfer_to_picking(self): + self.order.action_confirm() + self.assertEqual( + self.order.order_line.move_ids.description_picking, "Custom description" + ) + self.order.order_line.name = "Custom description 2" + self.assertEqual( + self.order.order_line.move_ids.description_picking, + self.order.order_line.name, + )