-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][ADD] stock_picking_packaging_report: Stock picking packaging r…
…eport.
- Loading branch information
1 parent
bc8ef4b
commit 93cba1d
Showing
13 changed files
with
260 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
setup/stock_picking_packaging_report/odoo/addons/stock_picking_packaging_report
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../stock_picking_packaging_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
<https://github.com/avanzosc/odoo-addons/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 <anajuaristi@avanzosc.es> | ||
* Alfredo de la Fuente <alfredodelafuente@avanzosc.es> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
21 changes: 21 additions & 0 deletions
21
stock_picking_packaging_report/i18n/stock_picking_packaging_report.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import stock_move_line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
73 changes: 73 additions & 0 deletions
73
stock_picking_packaging_report/report/report_deliveryslip.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<template id="report_delivery_document" inherit_id="stock.report_delivery_document"> | ||
<xpath expr="//td/span[@t-field='move.product_uom_qty']/.." position="inside"> | ||
<div | ||
t-if="move.product_packaging_id" | ||
groups="product.group_stock_packaging" | ||
class="text-secondary" | ||
style="white-space: nowrap;" | ||
> | ||
<span t-field="move.product_packaging_id.name" /> | ||
</div> | ||
</xpath> | ||
<xpath expr="//td/span[@t-field='move.quantity_done']/.." position="inside"> | ||
<div | ||
t-if="move.product_packaging_id" | ||
groups="product.group_stock_packaging" | ||
class="text-secondary" | ||
style="white-space: nowrap;" | ||
> | ||
<span t-field="move.product_packaging_id.name" /> | ||
</div> | ||
</xpath> | ||
<xpath | ||
expr="//td/span[@t-field='bo_line.product_uom_qty']/.." | ||
position="inside" | ||
> | ||
<div | ||
t-if="bo_line.product_packaging_id" | ||
groups="product.group_stock_packaging" | ||
class="text-secondary" | ||
style="white-space: nowrap;" | ||
> | ||
<span t-field="bo_line.product_packaging_id.name" /> | ||
</div> | ||
</xpath> | ||
</template> | ||
|
||
<template | ||
id="stock_report_delivery_has_serial_move_line" | ||
inherit_id="stock.stock_report_delivery_has_serial_move_line" | ||
> | ||
<xpath expr="//td/span[@t-field='move_line.qty_done']/.." position="inside"> | ||
<div | ||
t-if="move_line.product_packaging_id" | ||
groups="product.group_stock_packaging" | ||
class="text-secondary" | ||
style="white-space: nowrap;" | ||
> | ||
<span t-field="move_line.product_packaging_id.name" /> | ||
</div> | ||
</xpath> | ||
</template> | ||
|
||
<template | ||
id="stock_report_delivery_aggregated_move_lines" | ||
inherit_id="stock.stock_report_delivery_aggregated_move_lines" | ||
> | ||
<t t-if="aggregated_lines[line]['qty_done']" position="after"> | ||
<t | ||
t-if="aggregated_lines[line]['qty_done'] and aggregated_lines[line]['product_packaging']" | ||
> | ||
<div | ||
groups="product.group_stock_packaging" | ||
class="text-secondary" | ||
style="white-space: nowrap;" | ||
> | ||
<span t-esc="aggregated_lines[line]['product_packaging'].name" /> | ||
</div> | ||
</t> | ||
</t> | ||
</template> | ||
</odoo> |