Skip to content

Commit 3168b87

Browse files
committed
[MIG] stock_packaging_calculator_packaging_level: Migration to 18.0
1 parent bdcf563 commit 3168b87

File tree

8 files changed

+26
-18
lines changed

8 files changed

+26
-18
lines changed

stock_packaging_calculator_packaging_level/README.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,15 @@ Contributors
6868
- `Trobz <https://trobz.com>`__:
6969

7070
- Nguyen Hoang Hiep <[email protected]>
71+
- Khoi (Kien Kim) <[email protected]>
7172

7273
Other credits
7374
-------------
7475

75-
The migration of this module from 13.0 to 14.0 was financially supported
76-
by Camptocamp
76+
The migration of this module from 13.0 to 14.0 and then from 16.0 to
77+
18.0 was financially supported by:
78+
79+
- Camptocamp
7780

7881
Maintainers
7982
-----------

stock_packaging_calculator_packaging_level/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Stock packaging calculator packaging level",
55
"summary": "Glue module for packaging level",
6-
"version": "16.0.1.0.0",
6+
"version": "18.0.1.0.0",
77
"development_status": "Alpha",
88
"category": "Warehouse Management",
99
"website": "https://github.com/OCA/stock-logistics-warehouse",

stock_packaging_calculator_packaging_level/models/product.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ def _packaging_name_getter(self, packaging):
1212

1313
def _qty_by_packaging_as_str(self, packaging, qty):
1414
# By default use packaging type code
15-
qty_by_packaging_type_fname = self.env.context.get(
16-
"qty_by_packaging_type_fname", "code"
15+
qty_by_packaging_level_fname = self.env.context.get(
16+
"qty_by_packaging_level_fname", "code"
1717
)
18-
compact_mode = self.env.context.get("qty_by_packaging_type_compact", True)
18+
compact_mode = self.env.context.get("qty_by_packaging_level_compact", True)
1919
sep = "" if compact_mode else " "
2020
# Override to use packaging level code
2121
if packaging and packaging.packaging_level_id:
22-
name = packaging.packaging_level_id[qty_by_packaging_type_fname]
22+
name = packaging.packaging_level_id[qty_by_packaging_level_fname]
2323
return f"{qty}{sep}{name}"
24-
else:
25-
return super()._qty_by_packaging_as_str(packaging, qty)
24+
return super()._qty_by_packaging_as_str(packaging, qty)

stock_packaging_calculator_packaging_level/models/product_qty_by_packaging_mixin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class ProductQtyByPackagingMixin(models.AbstractModel):
1515
@api.depends_context(
1616
"lang",
1717
"qty_by_pkg_total_units",
18-
"qty_by_packaging_type_fname",
19-
"qty_by_packaging_type_compact",
18+
"qty_by_packaging_level_fname",
19+
"qty_by_packaging_level_compact",
2020
)
2121
def _compute_product_qty_by_packaging_display(self):
2222
return super()._compute_product_qty_by_packaging_display()
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
- Simone Orsi \<<[email protected]>\>
22

3-
- [Trobz](https://trobz.com):
3+
- [Trobz](https://trobz.com):
44
- Nguyen Hoang Hiep \<<[email protected]>\>
5+
- Khoi (Kien Kim) \<<[email protected]>\>
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
The migration of this module from 13.0 to 14.0 was financially supported
2-
by Camptocamp
1+
The migration of this module from 13.0 to 14.0 and then from 16.0 to 18.0 was financially supported by:
2+
3+
- Camptocamp

stock_packaging_calculator_packaging_level/static/description/index.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,18 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
413413
<li>Simone Orsi &lt;<a class="reference external" href="mailto:simone.orsi&#64;camptocamp.com">simone.orsi&#64;camptocamp.com</a>&gt;</li>
414414
<li><a class="reference external" href="https://trobz.com">Trobz</a>:<ul>
415415
<li>Nguyen Hoang Hiep &lt;<a class="reference external" href="mailto:hiepnh&#64;trobz.com">hiepnh&#64;trobz.com</a>&gt;</li>
416+
<li>Khoi (Kien Kim) &lt;<a class="reference external" href="mailto:khoikk&#64;trobz.com">khoikk&#64;trobz.com</a>&gt;</li>
416417
</ul>
417418
</li>
418419
</ul>
419420
</div>
420421
<div class="section" id="other-credits">
421422
<h2><a class="toc-backref" href="#toc-entry-5">Other credits</a></h2>
422-
<p>The migration of this module from 13.0 to 14.0 was financially supported
423-
by Camptocamp</p>
423+
<p>The migration of this module from 13.0 to 14.0 and then from 16.0 to
424+
18.0 was financially supported by:</p>
425+
<ul class="simple">
426+
<li>Camptocamp</li>
427+
</ul>
424428
</div>
425429
<div class="section" id="maintainers">
426430
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>

stock_packaging_calculator_packaging_level/tests/test_packaging_by_qty.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def test_as_str(self):
4949
)
5050
self.assertEqual(
5151
self.product_a.with_context(
52-
qty_by_packaging_type_fname="name",
53-
qty_by_packaging_type_compact=False,
52+
qty_by_packaging_level_fname="name",
53+
qty_by_packaging_level_compact=False,
5454
).product_qty_by_packaging_as_str(250),
5555
"1 Transport Box,\xa01 Retail Box",
5656
)

0 commit comments

Comments
 (0)