diff --git a/stock_picking_report_custom_description/__manifest__.py b/stock_picking_report_custom_description/__manifest__.py index d881d1d..a0a6f6b 100644 --- a/stock_picking_report_custom_description/__manifest__.py +++ b/stock_picking_report_custom_description/__manifest__.py @@ -1,12 +1,13 @@ # 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": "15.0.1.0.0", + "version": "16.0.1.0.0", "category": "Warehouse", "website": "https://github.com/OCA/stock-logistics-reporting", "author": "Tecnativa, Odoo Community Association (OCA)", @@ -16,9 +17,5 @@ "depends": [ "sale_stock", ], - "data": [ - "views/report_deliveryslip.xml", - "views/report_stockpicking_operations.xml", - "views/stock_report.xml", - ], + "data": [], } diff --git a/stock_picking_report_custom_description/models/__init__.py b/stock_picking_report_custom_description/models/__init__.py index c6e6e2f..0745213 100644 --- a/stock_picking_report_custom_description/models/__init__.py +++ b/stock_picking_report_custom_description/models/__init__.py @@ -1,2 +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 index 041dc83..0869659 100644 --- a/stock_picking_report_custom_description/models/stock_rule.py +++ b/stock_picking_report_custom_description/models/stock_rule.py @@ -31,5 +31,6 @@ class StockRule(models.Model): ) 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 index 0b7af09..82d59ed 100644 --- a/stock_picking_report_custom_description/readme/CONTRIBUTORS.rst +++ b/stock_picking_report_custom_description/readme/CONTRIBUTORS.rst @@ -4,3 +4,4 @@ * 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 index a2d382e..d36ec0e 100644 --- a/stock_picking_report_custom_description/readme/DESCRIPTION.rst +++ b/stock_picking_report_custom_description/readme/DESCRIPTION.rst @@ -1,2 +1,3 @@ -This module transfers the sales order line description to the picking, and +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 index 66a59ec..2d894a0 100644 --- a/stock_picking_report_custom_description/readme/USAGE.rst +++ b/stock_picking_report_custom_description/readme/USAGE.rst @@ -3,8 +3,4 @@ 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). +#. You can check sales order line description is the same as description picking diff --git a/stock_picking_report_custom_description/static/description/index.html b/stock_picking_report_custom_description/static/description/index.html index 41b3f09..ad9f177 100644 --- a/stock_picking_report_custom_description/static/description/index.html +++ b/stock_picking_report_custom_description/static/description/index.html @@ -424,6 +424,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome