diff --git a/setup/stock_picking_packaging_report/odoo/addons/stock_picking_packaging_report b/setup/stock_picking_packaging_report/odoo/addons/stock_picking_packaging_report new file mode 120000 index 0000000000..fc9d54df52 --- /dev/null +++ b/setup/stock_picking_packaging_report/odoo/addons/stock_picking_packaging_report @@ -0,0 +1 @@ +../../../../stock_picking_packaging_report \ No newline at end of file diff --git a/setup/stock_picking_packaging_report/setup.py b/setup/stock_picking_packaging_report/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/stock_picking_packaging_report/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_picking_packaging_report/README.rst b/stock_picking_packaging_report/README.rst new file mode 100644 index 0000000000..0806dc420c --- /dev/null +++ b/stock_picking_packaging_report/README.rst @@ -0,0 +1,28 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============================== +Stock picking packaging report +============================== + +* In stock picking report print packaging. + +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 smash it by providing detailed and welcomed feedback. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Contributors +------------ + +* Ana Juaristi +* Alfredo de la Fuente diff --git a/stock_picking_packaging_report/__init__.py b/stock_picking_packaging_report/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/stock_picking_packaging_report/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/stock_picking_packaging_report/__manifest__.py b/stock_picking_packaging_report/__manifest__.py new file mode 100644 index 0000000000..a2f4e3f58e --- /dev/null +++ b/stock_picking_packaging_report/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2024 Alfredo de la Fuente - AvanzOSC +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "Stock Picking Packaging Report", + "version": "16.0.1.0.0", + "author": "Avanzosc", + "website": "https://github.com/avanzosc/odoo-addons", + "category": "Inventory/Inventory", + "license": "AGPL-3", + "depends": [ + "stock_move_qty_by_packaging", + ], + "data": [ + "report/report_deliveryslip.xml", + ], + "installable": True, +} diff --git a/stock_picking_packaging_report/i18n/ca_ES.po b/stock_picking_packaging_report/i18n/ca_ES.po new file mode 100644 index 0000000000..ad43cb6802 --- /dev/null +++ b/stock_picking_packaging_report/i18n/ca_ES.po @@ -0,0 +1,21 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_packaging_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-12-10 11:12+0000\n" +"PO-Revision-Date: 2024-12-10 11:12+0000\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_packaging_report +#: model:ir.model,name:stock_picking_packaging_report.model_stock_move_line +msgid "Product Moves (Stock Move Line)" +msgstr "Moviment del producte (lĂ­nia de moviment d'estoc)" diff --git a/stock_picking_packaging_report/i18n/en_GB.po b/stock_picking_packaging_report/i18n/en_GB.po new file mode 100644 index 0000000000..541e52bdeb --- /dev/null +++ b/stock_picking_packaging_report/i18n/en_GB.po @@ -0,0 +1,21 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_packaging_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-12-10 11:12+0000\n" +"PO-Revision-Date: 2024-12-10 11:12+0000\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_packaging_report +#: model:ir.model,name:stock_picking_packaging_report.model_stock_move_line +msgid "Product Moves (Stock Move Line)" +msgstr "" diff --git a/stock_picking_packaging_report/i18n/es.po b/stock_picking_packaging_report/i18n/es.po new file mode 100644 index 0000000000..fb220ba9a6 --- /dev/null +++ b/stock_picking_packaging_report/i18n/es.po @@ -0,0 +1,21 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_packaging_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-12-10 11:13+0000\n" +"PO-Revision-Date: 2024-12-10 11:13+0000\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_packaging_report +#: model:ir.model,name:stock_picking_packaging_report.model_stock_move_line +msgid "Product Moves (Stock Move Line)" +msgstr "Movimientos de Producto (Stock Move Line)" diff --git a/stock_picking_packaging_report/i18n/fr.po b/stock_picking_packaging_report/i18n/fr.po new file mode 100644 index 0000000000..798e206509 --- /dev/null +++ b/stock_picking_packaging_report/i18n/fr.po @@ -0,0 +1,21 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_packaging_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-12-10 11:12+0000\n" +"PO-Revision-Date: 2024-12-10 11:12+0000\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_packaging_report +#: model:ir.model,name:stock_picking_packaging_report.model_stock_move_line +msgid "Product Moves (Stock Move Line)" +msgstr "Mouvements de stock" diff --git a/stock_picking_packaging_report/i18n/stock_picking_packaging_report.pot b/stock_picking_packaging_report/i18n/stock_picking_packaging_report.pot new file mode 100644 index 0000000000..9bd35a1153 --- /dev/null +++ b/stock_picking_packaging_report/i18n/stock_picking_packaging_report.pot @@ -0,0 +1,21 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_packaging_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-12-10 11:11+0000\n" +"PO-Revision-Date: 2024-12-10 11:11+0000\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_packaging_report +#: model:ir.model,name:stock_picking_packaging_report.model_stock_move_line +msgid "Product Moves (Stock Move Line)" +msgstr "" diff --git a/stock_picking_packaging_report/models/__init__.py b/stock_picking_packaging_report/models/__init__.py new file mode 100644 index 0000000000..431f51c274 --- /dev/null +++ b/stock_picking_packaging_report/models/__init__.py @@ -0,0 +1 @@ +from . import stock_move_line diff --git a/stock_picking_packaging_report/models/stock_move_line.py b/stock_picking_packaging_report/models/stock_move_line.py new file mode 100644 index 0000000000..c251f2ac0c --- /dev/null +++ b/stock_picking_packaging_report/models/stock_move_line.py @@ -0,0 +1,28 @@ +# Copyright 2023 Alfredo de la Fuente - AvanzOSC +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import models + + +class StockMoveLine(models.Model): + _inherit = "stock.move.line" + + def _get_aggregated_product_quantities(self, **kwargs): + result = super()._get_aggregated_product_quantities(**kwargs) + for clave in result.keys(): + for move_line in self.filtered( + lambda x: x.move_id and x.qty_done and x.product_packaging_id + ): + line_key = self._generate_keys_to_found() + if line_key in clave: + result[clave]["product_packaging"] = move_line.product_packaging_id + return result + + def _generate_keys_to_found(self): + uom = self.product_uom_id + name = self.product_id.display_name + description = self.move_id.description_picking + product = self.product_id + if description == name or description == self.product_id.name: + description = False + line_key = f'{product.id}_{product.display_name}_{description or ""}_{uom.id}' + return line_key diff --git a/stock_picking_packaging_report/report/report_deliveryslip.xml b/stock_picking_packaging_report/report/report_deliveryslip.xml new file mode 100644 index 0000000000..2ab516383c --- /dev/null +++ b/stock_picking_packaging_report/report/report_deliveryslip.xml @@ -0,0 +1,73 @@ + + + + + + + +