From c2ded5f96f9781b95e8c69e86c169af6059ba4b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20G=C3=B6ttsch?=
Date: Thu, 28 May 2026 10:53:01 +0200
Subject: [PATCH] [IMP] nfu_sale_order_batch_packaging: add automatic fillup
---
nfu_sale_order_batch_packaging/README.rst | 27 ++++----
.../__manifest__.py | 2 +-
.../models/sale_order_batch.py | 5 +-
.../readme/HISTORY.rst | 27 ++++----
.../static/description/index.html | 27 ++++----
.../tests/test_batch_packaging_reconcile.py | 44 +++++++++---
.../views/sale_order_batch_views.xml | 67 +++++++++----------
.../sale_order_batch_packaging_reconcile.py | 12 ++++
..._order_batch_packaging_reconcile_views.xml | 10 ++-
9 files changed, 132 insertions(+), 89 deletions(-)
diff --git a/nfu_sale_order_batch_packaging/README.rst b/nfu_sale_order_batch_packaging/README.rst
index 89030df..45c7970 100644
--- a/nfu_sale_order_batch_packaging/README.rst
+++ b/nfu_sale_order_batch_packaging/README.rst
@@ -33,23 +33,24 @@ and adds a packaging default to sale order batch.
Changelog
=========
-- 0.0.1: Initial module.
-- 1.0.0: rename to nfu_sale_order_batch_packaging
-- 1.1.0: Live
-- 1.2.0: Add regeneration action for batch products
-- 1.2.1: refactoring
-- 1.3.0: add packaging states
-- 1.3.1: add open_max_qty
-- 1.3.2: fix color indicator
-- 1.3.3: Enable packagings on installation
-- 1.3.4:
+- 16.0.0.0.1: Initial module.
+- 16.0.1.0.0: rename to nfu_sale_order_batch_packaging
+- 16.0.1.16.0.1.0: Live
+- 16.0.1.2.0: Add regeneration action for batch products
+- 16.0.1.2.1: refactoring
+- 16.0.1.3.0: add packaging states
+- 16.0.1.3.1: add open_max_qty
+- 16.0.1.3.2: fix color indicator
+- 16.0.1.3.3: Enable packagings on installation
+- 16.0.1.3.4:
- on creation set max_qty to product_uom_qty if not set
- remove zero exception for max_qty
- store open_packaging_qty on batch product module to make it sortable
- always adjust max_qty to be at least uom_qty except you only set max qty
-- 1.3.4: store all quantities and round open values
-- 1.3.6: make sure packages are readable by the user
-- 1.3.7: really make sure packages are readable by the user
+- 16.0.1.3.4: store all quantities and round open values
+- 16.0.1.3.6: make sure packages are readable by the user
+- 16.0.1.3.7: really make sure packages are readable by the user
+- 16.0.1.4.0: Add automatiok batch fillup
Bug Tracker
===========
diff --git a/nfu_sale_order_batch_packaging/__manifest__.py b/nfu_sale_order_batch_packaging/__manifest__.py
index e728f96..3805122 100644
--- a/nfu_sale_order_batch_packaging/__manifest__.py
+++ b/nfu_sale_order_batch_packaging/__manifest__.py
@@ -4,7 +4,7 @@
"author": "BAKEUP",
"website": "https://www.bakeup.org",
"category": "Sale",
- "version": "16.0.1.3.7",
+ "version": "16.0.1.4.0",
"depends": ["sale", "sale_order_batch"],
"data": [
"security/ir.model.access.csv",
diff --git a/nfu_sale_order_batch_packaging/models/sale_order_batch.py b/nfu_sale_order_batch_packaging/models/sale_order_batch.py
index 56c1ab4..c7f877d 100644
--- a/nfu_sale_order_batch_packaging/models/sale_order_batch.py
+++ b/nfu_sale_order_batch_packaging/models/sale_order_batch.py
@@ -22,12 +22,11 @@ class SaleOrderBatch(models.Model):
for line in batch.sale_order_line_ids
)
- @api.depends("product_ids.open_packaging_qty", "product_ids.open_packaging_max_qty")
+ @api.depends("product_ids.open_packaging_qty")
def _compute_has_fillable_packages(self):
for batch in self:
batch.has_fillable_packages = any(
- p.open_packaging_qty > 0 and p.open_packaging_max_qty == 0.0
- for p in batch.product_ids
+ p.open_packaging_qty > 0 for p in batch.product_ids
)
def action_restore_ordered_qty(self):
diff --git a/nfu_sale_order_batch_packaging/readme/HISTORY.rst b/nfu_sale_order_batch_packaging/readme/HISTORY.rst
index 53a9977..df31a30 100644
--- a/nfu_sale_order_batch_packaging/readme/HISTORY.rst
+++ b/nfu_sale_order_batch_packaging/readme/HISTORY.rst
@@ -1,17 +1,18 @@
-- 0.0.1: Initial module.
-- 1.0.0: rename to nfu_sale_order_batch_packaging
-- 1.1.0: Live
-- 1.2.0: Add regeneration action for batch products
-- 1.2.1: refactoring
-- 1.3.0: add packaging states
-- 1.3.1: add open_max_qty
-- 1.3.2: fix color indicator
-- 1.3.3: Enable packagings on installation
-- 1.3.4:
+- 16.0.0.0.1: Initial module.
+- 16.0.1.0.0: rename to nfu_sale_order_batch_packaging
+- 16.0.1.16.0.1.0: Live
+- 16.0.1.2.0: Add regeneration action for batch products
+- 16.0.1.2.1: refactoring
+- 16.0.1.3.0: add packaging states
+- 16.0.1.3.1: add open_max_qty
+- 16.0.1.3.2: fix color indicator
+- 16.0.1.3.3: Enable packagings on installation
+- 16.0.1.3.4:
- on creation set max_qty to product_uom_qty if not set
- remove zero exception for max_qty
- store open_packaging_qty on batch product module to make it sortable
- always adjust max_qty to be at least uom_qty except you only set max qty
-- 1.3.4: store all quantities and round open values
-- 1.3.6: make sure packages are readable by the user
-- 1.3.7: really make sure packages are readable by the user
\ No newline at end of file
+- 16.0.1.3.4: store all quantities and round open values
+- 16.0.1.3.6: make sure packages are readable by the user
+- 16.0.1.3.7: really make sure packages are readable by the user
+- 16.0.1.4.0: Add automatiok batch fillup
\ No newline at end of file
diff --git a/nfu_sale_order_batch_packaging/static/description/index.html b/nfu_sale_order_batch_packaging/static/description/index.html
index d14fce9..012dcf4 100644
--- a/nfu_sale_order_batch_packaging/static/description/index.html
+++ b/nfu_sale_order_batch_packaging/static/description/index.html
@@ -388,17 +388,17 @@ and adds a packaging default to sale order batch.