mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[MIG] stock_measuring_device_zippcube: Migration to 14.0
This commit is contained in:
@@ -14,13 +14,13 @@ Stock Zippcube
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_measuring_device_zippcube
|
||||
:target: https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_measuring_device_zippcube
|
||||
:alt: OCA/stock-logistics-warehouse
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_measuring_device_zippcube
|
||||
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-14-0/stock-logistics-warehouse-14-0-stock_measuring_device_zippcube
|
||||
:alt: Translate me on Weblate
|
||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||
:target: https://runbot.odoo-community.org/runbot/153/13.0
|
||||
:target: https://runbot.odoo-community.org/runbot/153/14.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
@@ -82,7 +82,7 @@ Bug Tracker
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_measuring_device_zippcube%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_measuring_device_zippcube%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
@@ -100,6 +100,13 @@ Contributors
|
||||
* Patrick Tombez <patrick.tombez@camptocamp.com>
|
||||
* Alexandre Fayolle <alexandre.fayolle@camptocamp.com>
|
||||
* Carlos Serra Toro <carlos.serra@camptocamp.com>
|
||||
* `Trobz <https://trobz.com>`_:
|
||||
* Hai Lang <hailn@trobz.com>
|
||||
|
||||
Other credits
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
The migration of this module from 13.0 to 14.0 was financially supported by Camptocamp
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
@@ -122,6 +129,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
||||
|
||||
|maintainer-gurneyalex|
|
||||
|
||||
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_measuring_device_zippcube>`_ project on GitHub.
|
||||
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_measuring_device_zippcube>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"name": "Stock Zippcube",
|
||||
"summary": "Implement interface with Bosche Zippcube devices"
|
||||
"for packaging measurement",
|
||||
"version": "13.0.1.1.0",
|
||||
"version": "14.0.1.0.0",
|
||||
"category": "Warehouse",
|
||||
"author": "Camptocamp, Odoo Community Association (OCA)",
|
||||
"license": "AGPL-3",
|
||||
|
||||
@@ -27,7 +27,7 @@ class ZippcubeDevice(Component):
|
||||
data[key] = value
|
||||
return {
|
||||
"max_weight": data["weight"],
|
||||
"lngth": data["length"],
|
||||
"packaging_length": data["length"],
|
||||
"width": data["width"],
|
||||
"height": data["height"],
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
* Patrick Tombez <patrick.tombez@camptocamp.com>
|
||||
* Alexandre Fayolle <alexandre.fayolle@camptocamp.com>
|
||||
* Carlos Serra Toro <carlos.serra@camptocamp.com>
|
||||
* `Trobz <https://trobz.com>`_:
|
||||
* Hai Lang <hailn@trobz.com>
|
||||
|
||||
1
stock_measuring_device_zippcube/readme/CREDITS.rst
Normal file
1
stock_measuring_device_zippcube/readme/CREDITS.rst
Normal file
@@ -0,0 +1 @@
|
||||
The migration of this module from 13.0 to 14.0 was financially supported by Camptocamp
|
||||
@@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
|
||||
<title>Stock Zippcube</title>
|
||||
<style type="text/css">
|
||||
|
||||
@@ -367,7 +367,7 @@ ul.auto-toc {
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.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_measuring_device_zippcube"><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_measuring_device_zippcube"><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>
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.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_measuring_device_zippcube"><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_measuring_device_zippcube"><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>
|
||||
<p>Different manufacturers produce devices which are able to measure and weigh
|
||||
packages and parcels. Each brand has a different communication protocol. This
|
||||
module provides an framework to interface such devices with Odoo.</p>
|
||||
@@ -389,7 +389,8 @@ Only for development or testing purpose, do not use in production.
|
||||
<li><a class="reference internal" href="#credits" id="id5">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id6">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id7">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id8">Maintainers</a></li>
|
||||
<li><a class="reference internal" href="#other-credits" id="id8">Other credits</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id9">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -425,7 +426,7 @@ measurements.</p>
|
||||
<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 smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_measuring_device_zippcube%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_measuring_device_zippcube%0Aversion:%2014.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">
|
||||
@@ -442,10 +443,22 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||
<li>Patrick Tombez <<a class="reference external" href="mailto:patrick.tombez@camptocamp.com">patrick.tombez@camptocamp.com</a>></li>
|
||||
<li>Alexandre Fayolle <<a class="reference external" href="mailto:alexandre.fayolle@camptocamp.com">alexandre.fayolle@camptocamp.com</a>></li>
|
||||
<li>Carlos Serra Toro <<a class="reference external" href="mailto:carlos.serra@camptocamp.com">carlos.serra@camptocamp.com</a>></li>
|
||||
<li><dl class="first docutils">
|
||||
<dt><a class="reference external" href="https://trobz.com">Trobz</a>:</dt>
|
||||
<dd><ul class="first last">
|
||||
<li>Hai Lang <<a class="reference external" href="mailto:hailn@trobz.com">hailn@trobz.com</a>></li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="other-credits">
|
||||
<h2><a class="toc-backref" href="#id8">Other credits</a></h2>
|
||||
<p>The migration of this module from 13.0 to 14.0 was financially supported by Camptocamp</p>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
|
||||
<h2><a class="toc-backref" href="#id9">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" /></a>
|
||||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
@@ -453,7 +466,7 @@ mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.</p>
|
||||
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
|
||||
<p><a class="reference external" href="https://github.com/gurneyalex"><img alt="gurneyalex" src="https://github.com/gurneyalex.png?size=40px" /></a></p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_measuring_device_zippcube">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_measuring_device_zippcube">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -74,28 +74,33 @@ class TestZippcubeWizard(SavepointComponentCase):
|
||||
self.assertEqual(self.wizard.product_id, self.product_1)
|
||||
self.assertEqual(len(self.wizard.line_ids), 6)
|
||||
|
||||
def test_zippcube_measures(self):
|
||||
def setup_wizard(self, verify=True):
|
||||
self.wizard.product_id = self.product_1.id
|
||||
self.wizard.onchange_product_id()
|
||||
fields = ["packaging_length", "width", "height", "max_weight", "volume"]
|
||||
for idx, line in enumerate(self.wizard.line_ids):
|
||||
return_value = TestZippcubeWizard.get_measure_result(
|
||||
100 * 2 ** idx, 100, 100, 3 ** idx
|
||||
)
|
||||
line.measuring_select_for_measure()
|
||||
self.device._update_packaging_measures(return_value)
|
||||
if not verify:
|
||||
continue
|
||||
self.assertEqual(
|
||||
line.read(["lngth", "width", "height", "max_weight", "volume"])[0],
|
||||
line.read(fields)[0],
|
||||
{
|
||||
"id": line.id,
|
||||
"lngth": (2 ** idx) * 1000,
|
||||
"packaging_length": (2 ** idx) * 1000,
|
||||
"width": 1000,
|
||||
"height": 1000,
|
||||
"max_weight": 3.0 ** idx,
|
||||
"volume": 2.0 ** idx,
|
||||
},
|
||||
)
|
||||
|
||||
self.wizard.action_save()
|
||||
|
||||
def test_zippcube_measures(self):
|
||||
self.setup_wizard()
|
||||
mm_uom = self.env.ref("stock_measuring_device.product_uom_mm")
|
||||
self.assertEqual(
|
||||
self.product_1.read(
|
||||
@@ -120,15 +125,51 @@ class TestZippcubeWizard(SavepointComponentCase):
|
||||
)
|
||||
packagings = self.product_1.packaging_ids.sorted()
|
||||
self.assertEqual(len(packagings), 5)
|
||||
self.assertEqual(set(packagings.mapped("length_uom_name")), {"mm"})
|
||||
for idx, packaging in enumerate(packagings, 1):
|
||||
self.assertEqual(
|
||||
packaging.read(["lngth", "width", "height", "max_weight", "volume"])[0],
|
||||
packaging.read(
|
||||
["packaging_length", "width", "height", "max_weight", "volume"]
|
||||
)[0],
|
||||
{
|
||||
"id": packaging.id,
|
||||
"lngth": (2 ** idx) * 1000,
|
||||
"packaging_length": (2 ** idx) * 1000,
|
||||
"width": 1000,
|
||||
"height": 1000,
|
||||
"max_weight": 3.0 ** idx,
|
||||
"volume": 2.0 ** idx,
|
||||
},
|
||||
)
|
||||
|
||||
def test_wizard_actions(self):
|
||||
self.setup_wizard(verify=False)
|
||||
res = self.wizard.action_reopen_fullscreen()
|
||||
self.assertEqual(res["res_id"], self.wizard.id)
|
||||
res = self.wizard.reload()
|
||||
self.assertEqual(res, {"type": "ir.actions.act_view_reload"})
|
||||
self.wizard._notify("Test message")
|
||||
self.wizard.line_ids[-1].scan_requested = True
|
||||
res = self.wizard.action_close()
|
||||
self.assertEqual(
|
||||
res,
|
||||
{
|
||||
"type": "ir.actions.act_window",
|
||||
"res_model": self.device._name,
|
||||
"res_id": self.device.id,
|
||||
"view_mode": "form",
|
||||
"target": "main",
|
||||
"flags": {"headless": False, "clear_breadcrumbs": True},
|
||||
},
|
||||
)
|
||||
test_product = self.product_2
|
||||
self.assertNotEqual(self.wizard.product_id, test_product)
|
||||
test_product.packaging_ids[1].measuring_device_id = self.device
|
||||
res = self.device.open_wizard()
|
||||
self.assertEqual(res["context"]["default_product_id"], test_product.id)
|
||||
self.wizard.retrieve_product()
|
||||
self.assertEqual(self.wizard.product_id, test_product)
|
||||
self.assertFalse(self.wizard.line_ids[-1].measuring_select_for_measure())
|
||||
self.assertTrue(self.wizard.line_ids[-1].measuring_select_for_measure_cancel())
|
||||
self.device.state = "not_ready"
|
||||
self.device.test_device()
|
||||
self.assertEqual(self.device.state, "ready")
|
||||
|
||||
Reference in New Issue
Block a user