Skip to content

Commit 3167ca8

Browse files
alan196lk-eska
authored andcommitted
[MIG] stock_secondary_unit: migration to V14.
1 parent 39f7a0a commit 3167ca8

File tree

8 files changed

+55
-46
lines changed

8 files changed

+55
-46
lines changed

stock_secondary_unit/README.rst

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ Stock Secondary Unit
1414
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1515
:alt: License: AGPL-3
1616
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github
17-
:target: https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_secondary_unit
17+
:target: https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_secondary_unit
1818
:alt: OCA/stock-logistics-warehouse
1919
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
20-
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_secondary_unit
20+
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-14-0/stock-logistics-warehouse-14-0-stock_secondary_unit
2121
:alt: Translate me on Weblate
2222
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23-
:target: https://runbot.odoo-community.org/runbot/153/13.0
23+
:target: https://runbot.odoo-community.org/runbot/153/14.0
2424
:alt: Try me on Runbot
2525

2626
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -51,7 +51,7 @@ Bug Tracker
5151
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/issues>`_.
5252
In case of trouble, please check there if your issue has already been reported.
5353
If you spotted it first, help us smashing it by providing a detailed and welcomed
54-
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_secondary_unit%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
54+
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_secondary_unit%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5555

5656
Do not contact contributors directly about support or help with technical issues.
5757

@@ -70,6 +70,7 @@ Contributors
7070
* Sergio Teruel <sergio.teruel@tecnativa.com>
7171
* Kitti Upariphutthiphong <kittiu@ecosoft.co.th>
7272
* Pimolnat Suntian <pimolnats@ecosoft.co.th>
73+
* Alan Ramos <alan.ramos@jarsa.com.mx>
7374

7475
Maintainers
7576
~~~~~~~~~~~
@@ -84,6 +85,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
8485
mission is to support the collaborative development of Odoo features and
8586
promote its widespread use.
8687

87-
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_secondary_unit>`_ project on GitHub.
88+
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_secondary_unit>`_ project on GitHub.
8889

8990
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

stock_secondary_unit/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Stock Secondary Unit",
55
"summary": "Get product quantities in a secondary unit",
6-
"version": "13.0.2.1.0",
6+
"version": "14.0.1.0.1",
77
"development_status": "Production/Stable",
88
"category": "stock",
99
"website": "https://github.com/OCA/stock-logistics-warehouse",

stock_secondary_unit/i18n/stock_secondary_unit.pot

+30-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
msgid ""
66
msgstr ""
7-
"Project-Id-Version: Odoo Server 13.0\n"
7+
"Project-Id-Version: Odoo Server 14.0\n"
88
"Report-Msgid-Bugs-To: \n"
99
"Last-Translator: \n"
1010
"Language-Team: \n"
@@ -19,6 +19,15 @@ msgid "<strong>Secondary Qty</strong>"
1919
msgstr ""
2020

2121
#. module: stock_secondary_unit
22+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move__product_uom_qty
23+
msgid "Demand"
24+
msgstr ""
25+
26+
#. module: stock_secondary_unit
27+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_product_product__display_name
28+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_product_template__display_name
29+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move__display_name
30+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move_line__display_name
2231
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_product_secondary_unit__display_name
2332
msgid "Display Name"
2433
msgstr ""
@@ -29,17 +38,19 @@ msgid "Done"
2938
msgstr ""
3039

3140
#. module: stock_secondary_unit
41+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_product_product__id
42+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_product_template__id
43+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move__id
44+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move_line__id
3245
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_product_secondary_unit__id
3346
msgid "ID"
3447
msgstr ""
3548

3649
#. module: stock_secondary_unit
37-
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move__product_uom_qty
38-
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_reservation__product_uom_qty
39-
msgid "Initial Demand"
40-
msgstr ""
41-
42-
#. module: stock_secondary_unit
50+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_product_product____last_update
51+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_product_template____last_update
52+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move____last_update
53+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move_line____last_update
4354
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_product_secondary_unit____last_update
4455
msgid "Last Modified on"
4556
msgstr ""
@@ -66,12 +77,24 @@ msgstr ""
6677
msgid "Quantity On Hand (2Unit)"
6778
msgstr ""
6879

80+
#. module: stock_secondary_unit
81+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move__secondary_uom_id
82+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move_line__secondary_uom_id
83+
msgid "Second unit"
84+
msgstr ""
85+
6986
#. module: stock_secondary_unit
7087
#: model:ir.model.fields,field_description:stock_secondary_unit.field_product_product__stock_secondary_uom_id
7188
#: model:ir.model.fields,field_description:stock_secondary_unit.field_product_template__stock_secondary_uom_id
7289
msgid "Second unit for inventory"
7390
msgstr ""
7491

92+
#. module: stock_secondary_unit
93+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move__secondary_uom_qty
94+
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move_line__secondary_uom_qty
95+
msgid "Secondary Qty"
96+
msgstr ""
97+
7598
#. module: stock_secondary_unit
7699
#: model_terms:ir.ui.view,arch_db:stock_secondary_unit.view_template_property_form
77100
msgid "Secondary unit"
@@ -89,7 +112,6 @@ msgstr ""
89112

90113
#. module: stock_secondary_unit
91114
#: model:ir.model.fields,help:stock_secondary_unit.field_stock_move__product_uom_qty
92-
#: model:ir.model.fields,help:stock_secondary_unit.field_stock_reservation__product_uom_qty
93115
msgid ""
94116
"This is the quantity of products from an inventory point of view. For moves "
95117
"in the state 'done', this is the quantity of products that were actually "

stock_secondary_unit/migrations/13.0.1.0.1/post-migration.py

-22
This file was deleted.

stock_secondary_unit/readme/CONTRIBUTORS.rst

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
* Sergio Teruel <sergio.teruel@tecnativa.com>
33
* Kitti Upariphutthiphong <kittiu@ecosoft.co.th>
44
* Pimolnat Suntian <pimolnats@ecosoft.co.th>
5+
* Alan Ramos <alan.ramos@jarsa.com.mx>

stock_secondary_unit/report/report_deliveryslip.xml

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
<strong>Secondary Qty</strong>
3030
</th>
3131
</xpath>
32+
</template>
33+
<template
34+
id="stock_report_delivery_has_serial_move_line"
35+
inherit_id="stock.stock_report_delivery_has_serial_move_line"
36+
>
3237
<xpath expr="//span[@t-field='move_line.product_id']/.." position="after">
3338
<td>
3439
<span t-field="move_line.secondary_uom_qty" />

stock_secondary_unit/static/description/index.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ <h1 class="title">Stock Secondary Unit</h1>
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
370-
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_secondary_unit"><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" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_secondary_unit"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/153/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
370+
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_secondary_unit"><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" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-14-0/stock-logistics-warehouse-14-0-stock_secondary_unit"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/153/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
371371
<p>This module extends the functionality of stock module to allow define
372372
other units with their conversion factor.</p>
373373
<p><strong>Table of contents</strong></p>
@@ -400,7 +400,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
400400
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues">GitHub Issues</a>.
401401
In case of trouble, please check there if your issue has already been reported.
402402
If you spotted it first, help us smashing it by providing a detailed and welcomed
403-
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_secondary_unit%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
403+
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_secondary_unit%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
404404
<p>Do not contact contributors directly about support or help with technical issues.</p>
405405
</div>
406406
<div class="section" id="credits">
@@ -418,6 +418,7 @@ <h2><a class="toc-backref" href="#id5">Contributors</a></h2>
418418
<li>Sergio Teruel &lt;<a class="reference external" href="mailto:sergio.teruel&#64;tecnativa.com">sergio.teruel&#64;tecnativa.com</a>&gt;</li>
419419
<li>Kitti Upariphutthiphong &lt;<a class="reference external" href="mailto:kittiu&#64;ecosoft.co.th">kittiu&#64;ecosoft.co.th</a>&gt;</li>
420420
<li>Pimolnat Suntian &lt;<a class="reference external" href="mailto:pimolnats&#64;ecosoft.co.th">pimolnats&#64;ecosoft.co.th</a>&gt;</li>
421+
<li>Alan Ramos &lt;<a class="reference external" href="mailto:alan.ramos&#64;jarsa.com.mx">alan.ramos&#64;jarsa.com.mx</a>&gt;</li>
421422
</ul>
422423
</div>
423424
<div class="section" id="maintainers">
@@ -427,7 +428,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
427428
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
428429
mission is to support the collaborative development of Odoo features and
429430
promote its widespread use.</p>
430-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_secondary_unit">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
431+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_secondary_unit">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
431432
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
432433
</div>
433434
</div>

stock_secondary_unit/tests/test_stock_secondary_unit.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def setUpClass(cls):
1616
cls.location_stock = cls.env.ref("stock.stock_location_stock")
1717
cls.picking_type_in = cls.env.ref("stock.picking_type_in")
1818
cls.picking_type_out = cls.env.ref("stock.picking_type_out")
19+
cls.picking_type_out.show_operations = True
1920

2021
cls.product_uom_kg = cls.env.ref("uom.product_uom_kgm")
2122
cls.product_uom_ton = cls.env.ref("uom.product_uom_ton")
@@ -135,15 +136,15 @@ def test_03_stock_picking_secondary_unit(self):
135136
delivery_order = StockPicking.create(do_vals)
136137
delivery_order.action_confirm()
137138
# Move is merged into 1 line for both stock.move and stock.move.line
138-
self.assertEquals(len(delivery_order.move_lines), 1)
139-
self.assertEquals(len(delivery_order.move_line_ids), 1)
139+
self.assertEqual(len(delivery_order.move_lines), 1)
140+
self.assertEqual(len(delivery_order.move_line_ids), 1)
140141
# Qty merged to 20, and secondary unit qty is 40line
141142
uom_qty = sum(delivery_order.move_lines.mapped("product_uom_qty"))
142143
secondary_uom_qty = sum(
143144
delivery_order.move_line_ids.mapped("secondary_uom_qty")
144145
)
145-
self.assertEquals(uom_qty, 20.0)
146-
self.assertEquals(secondary_uom_qty, 40.0)
146+
self.assertEqual(uom_qty, 20.0)
147+
self.assertEqual(secondary_uom_qty, 40.0)
147148

148149
def test_picking_secondary_unit(self):
149150
product = self.product_template.product_variant_ids[0]
@@ -205,7 +206,7 @@ def test_secondary_unit_merge_move_diff_uom(self):
205206
move.secondary_uom_id = product.secondary_uom_ids[1]
206207
picking = picking_form.save()
207208
picking.action_confirm()
208-
self.assertEquals(len(picking.move_lines), 2)
209+
self.assertEqual(len(picking.move_lines), 2)
209210

210211
def test_secondary_unit_merge_move_same_uom(self):
211212
product = self.product_template.product_variant_ids[0]
@@ -225,5 +226,5 @@ def test_secondary_unit_merge_move_same_uom(self):
225226
move.secondary_uom_id = product.secondary_uom_ids[0]
226227
picking = picking_form.save()
227228
picking.action_confirm()
228-
self.assertEquals(len(picking.move_lines), 1)
229-
self.assertEquals(picking.move_lines.secondary_uom_qty, 2)
229+
self.assertEqual(len(picking.move_lines), 1)
230+
self.assertEqual(picking.move_lines.secondary_uom_qty, 2)

0 commit comments

Comments
 (0)