Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions stock_move_packaging_qty/README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

===================
Stock Packaging Qty
===================
Expand All @@ -17,7 +13,7 @@ Stock Packaging Qty
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
.. |badge2| image:: https://img.shields.io/badge/licence-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--warehouse-lightgray.png?logo=github
Expand Down
3 changes: 2 additions & 1 deletion stock_move_packaging_qty/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Stock Packaging Qty",
"summary": "Add packaging fields in the stock moves",
"version": "18.0.1.1.1",
"version": "18.0.1.2.0",
"author": "ForgeFlow, Moduon, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"category": "Warehouse",
Expand All @@ -13,6 +13,7 @@
"views/stock_move_line_view.xml",
"views/stock_move_view.xml",
"views/stock_picking_view.xml",
"views/stock_picking_type_view.xml",
],
"pre_init_hook": "pre_init_hook",
"license": "LGPL-3",
Expand Down
40 changes: 30 additions & 10 deletions stock_move_packaging_qty/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0+e\n"
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-04-17 07:22+0000\n"
"PO-Revision-Date: 2026-04-17 07:22+0000\n"
"Last-Translator: David Vidal <david.vidal@tecnativa.com>\n"
"Language-Team: none\n"
"POT-Creation-Date: 2026-04-29 09:10+0000\n"
"PO-Revision-Date: 2026-04-29 11:12+0200\n"
"Last-Translator: \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: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.15.2\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.6\n"

#. module: stock_move_packaging_qty
#: model_terms:ir.ui.view,arch_db:stock_move_packaging_qty.view_stock_move_operations
Expand All @@ -27,6 +27,11 @@ msgstr "<span>(</span>"
msgid "<span>)</span>"
msgstr "<span>)</span>"

#. module: stock_move_packaging_qty
#: model:ir.model.fields,field_description:stock_move_packaging_qty.field_stock_picking_type__automatic_done_packaging_calculation
msgid "Automatically Calculate Done Packaging Quantity"
msgstr "Calcular Automáticamente Envases Hechos"

#. module: stock_move_packaging_qty
#: model:ir.model.fields,field_description:stock_move_packaging_qty.field_stock_move__product_packaging_quantity
#: model:ir.model.fields,field_description:stock_move_packaging_qty.field_stock_move_line__product_packaging_quantity
Expand All @@ -50,12 +55,17 @@ msgstr "Env. hechos"
#: model_terms:ir.ui.view,arch_db:stock_move_packaging_qty.view_stock_move_line_detailed_operation_tree
#: model_terms:ir.ui.view,arch_db:stock_move_packaging_qty.view_stock_move_line_operation_tree
msgid "Packaging"
msgstr "Envase"
msgstr "Embalaje"

#. module: stock_move_packaging_qty
#: model:ir.model,name:stock_move_packaging_qty.model_stock_picking_type
msgid "Picking Type"
msgstr "Tipo de albarán"

#. module: stock_move_packaging_qty
#: model:ir.model,name:stock_move_packaging_qty.model_stock_move_line
msgid "Product Moves (Stock Move Line)"
msgstr "Movimientos de existencias"
msgstr "Movimientos de producto (línea de movimiento de stock)"

#. module: stock_move_packaging_qty
#: model:ir.model.fields,help:stock_move_packaging_qty.field_stock_move_line__product_packaging_quantity
Expand All @@ -76,7 +86,17 @@ msgstr "Envs. reservados"
#. module: stock_move_packaging_qty
#: model:ir.model,name:stock_move_packaging_qty.model_stock_move
msgid "Stock Move"
msgstr "Movimiento de existencias"
msgstr "Movimiento de stock"

#. module: stock_move_packaging_qty
#: model:ir.model.fields,help:stock_move_packaging_qty.field_stock_picking_type__automatic_done_packaging_calculation
msgid ""
"The system calculates Done Packaging Automatically on Stock Move Lines.\n"
"Disable this to prevent automatic calculation."
msgstr ""
"El sistema calcula la Cantidad de Envases Hechos en las Línea de "
"movimientos de stock.\n"
"Desactiva esta opción para prevenir el cálculo automático."

#. module: stock_move_packaging_qty
#. odoo-python
Expand Down
19 changes: 19 additions & 0 deletions stock_move_packaging_qty/i18n/stock_move_packaging_qty.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-04-29 09:09+0000\n"
"PO-Revision-Date: 2026-04-29 09:09+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand All @@ -23,6 +25,11 @@ msgstr ""
msgid "<span>)</span>"
msgstr ""

#. module: stock_move_packaging_qty
#: model:ir.model.fields,field_description:stock_move_packaging_qty.field_stock_picking_type__automatic_done_packaging_calculation
msgid "Automatically Calculate Done Packaging Quantity"
msgstr ""

#. module: stock_move_packaging_qty
#: model:ir.model.fields,field_description:stock_move_packaging_qty.field_stock_move__product_packaging_quantity
#: model:ir.model.fields,field_description:stock_move_packaging_qty.field_stock_move_line__product_packaging_quantity
Expand All @@ -48,6 +55,11 @@ msgstr ""
msgid "Packaging"
msgstr ""

#. module: stock_move_packaging_qty
#: model:ir.model,name:stock_move_packaging_qty.model_stock_picking_type
msgid "Picking Type"
msgstr ""

#. module: stock_move_packaging_qty
#: model:ir.model,name:stock_move_packaging_qty.model_stock_move_line
msgid "Product Moves (Stock Move Line)"
Expand All @@ -74,6 +86,13 @@ msgstr ""
msgid "Stock Move"
msgstr ""

#. module: stock_move_packaging_qty
#: model:ir.model.fields,help:stock_move_packaging_qty.field_stock_picking_type__automatic_done_packaging_calculation
msgid ""
"The system calculates Done Packaging Automatically on Stock Move Lines.\n"
"Disable this to prevent automatic calculation."
msgstr ""

#. module: stock_move_packaging_qty
#. odoo-python
#: code:addons/stock_move_packaging_qty/models/stock_move.py:0
Expand Down
21 changes: 21 additions & 0 deletions stock_move_packaging_qty/migrations/18.0.1.2.0/post-migrate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2026 Moduon Team S.L. <info@moduon.team>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from odoo.tools import sql


def migrate(cr, version):
"""Activate Picking Type Automatic Done Packaging Calculation."""
if not sql.column_exists(
cr, "stock_picking_type", "automatic_done_packaging_calculation"
):
sql.create_column(
cr,
"stock_picking_type",
"automatic_done_packaging_calculation",
"boolean",
comment="Automatically Calculate Done Packaging Quantity",
)
cr.execute(
"UPDATE stock_picking_type SET automatic_done_packaging_calculation = True"
)
1 change: 1 addition & 0 deletions stock_move_packaging_qty/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from . import stock_move
from . import stock_picking_type
from . import stock_move_line
13 changes: 10 additions & 3 deletions stock_move_packaging_qty/models/stock_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@ class StockMoveLine(models.Model):
help="Quantity done in Product Packaging",
)

@api.depends("move_id.product_packaging_id", "product_uom_id", "quantity")
@api.depends(
"picking_type_id", "move_id.product_packaging_id", "product_uom_id", "quantity"
)
def _compute_product_packaging_quantity(self):
"""Set product_packaging_quantity automatically."""
self.product_packaging_quantity = 0
for line in self:
auto_fill_ppq = self.filtered_domain(
[
("picking_type_id.automatic_done_packaging_calculation", "=", True),
]
)
auto_fill_ppq.product_packaging_quantity = 0
for line in auto_fill_ppq:
if not line.move_id.product_packaging_id:
continue
# Same as product_packaging_qty at the first time
Expand Down
14 changes: 14 additions & 0 deletions stock_move_packaging_qty/models/stock_picking_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2026 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
from odoo import fields, models


class StockPickingType(models.Model):
_inherit = "stock.picking.type"

automatic_done_packaging_calculation = fields.Boolean(
string="Automatically Calculate Done Packaging Quantity",
default=True,
help="The system calculates Done Packaging Automatically on Stock Move Lines.\n"
"Disable this to prevent automatic calculation.",
)
26 changes: 10 additions & 16 deletions stock_move_packaging_qty/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>README.rst</title>
<title>Stock Packaging Qty</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,21 +360,16 @@
</style>
</head>
<body>
<div class="document">
<div class="document" id="stock-packaging-qty">
<h1 class="title">Stock Packaging Qty</h1>


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="stock-packaging-qty">
<h1>Stock Packaging Qty</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:188ca319b22f3031d3b78a85850a89d36dccd64c56bed1a58510fec876b26fcd
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-warehouse/tree/18.0/stock_move_packaging_qty"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-18-0/stock-logistics-warehouse-18-0-stock_move_packaging_qty"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-warehouse/tree/18.0/stock_move_packaging_qty"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-18-0/stock-logistics-warehouse-18-0-stock_move_packaging_qty"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Add packaging fields in the stock moves, their lines and their reports.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand All @@ -390,32 +385,32 @@ <h1>Stock Packaging Qty</h1>
</ul>
</div>
<div class="section" id="known-issues-roadmap">
<h2><a class="toc-backref" href="#toc-entry-1">Known issues / Roadmap</a></h2>
<h1><a class="toc-backref" href="#toc-entry-1">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>Since we store done product packaging quantities in the stock move
lines, we should be able to use this information in quants to provide
real packaging-based stock data.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_move_packaging_qty%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<ul class="simple">
<li>ForgeFlow</li>
<li>Moduon</li>
</ul>
</div>
<div class="section" id="contributors">
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li>Mateu Griful &lt;<a class="reference external" href="mailto:mateu.griful&#64;forgeflow.com">mateu.griful&#64;forgeflow.com</a>&gt;</li>
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;forgeflow.com">lois.rilo&#64;forgeflow.com</a>&gt;</li>
Expand All @@ -425,7 +420,7 @@ <h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
</ul>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand All @@ -440,6 +435,5 @@ <h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
</div>
</div>
</div>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ def test_product_packaging_quantity(self):
self.env["stock.quant"]._update_available_quantity(
self.product, self.stock_location, 10
)
# Disable Automatic Done Packaging Calculation
picking.picking_type_id.automatic_done_packaging_calculation = False
picking.action_assign()
self.assertEqual(
picking.move_ids_without_package.product_packaging_quantity, 0.0
)
picking.do_unreserve()
# Re-Enable Automatic Done Packaging Calculation
picking.picking_type_id.automatic_done_packaging_calculation = True
# Initial packaging quantity should be set
picking.action_assign()
self.assertEqual(
Expand Down
13 changes: 13 additions & 0 deletions stock_move_packaging_qty/views/stock_picking_type_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<data>
<record id="view_picking_type_form" model="ir.ui.view">
<field name="name">stock.picking.type.form</field>
<field name="model">stock.picking.type</field>
<field name="inherit_id" ref="stock.view_picking_type_form" />
<field name="arch" type="xml">
<xpath expr="//group[@name='first']/group[1]" position="inside">
<field name="automatic_done_packaging_calculation" />
</xpath>
</field>
</record>
</data>
Loading