-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da3bc34
commit 949d8af
Showing
14 changed files
with
118 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# generated from manifests external_dependencies | ||
biip==2.3.0 | ||
biip | ||
openupgradelib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,8 @@ Add GS1 barcode support to Shopfloor. | |
|
||
Based on https://biip.readthedocs.io/ | ||
|
||
TODO.... | ||
This module allows to use the biip library to interpret a scanned GS1 barcode | ||
and return the corresponding Odoo record for Shopfloor `find` method. | ||
|
||
**Table of contents** | ||
|
||
|
@@ -42,7 +43,7 @@ TODO.... | |
Usage | ||
===== | ||
|
||
TODO | ||
- You can use the `Scan` action in Shopfloor with a GS1 barcode. The | ||
|
||
Bug Tracker | ||
=========== | ||
|
@@ -67,6 +68,7 @@ Contributors | |
|
||
* Simone Orsi <[email protected]> | ||
* Sébastien Alix <[email protected]> | ||
* Denis Roussel <[email protected]> | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
* Simone Orsi <[email protected]> | ||
* Sébastien Alix <[email protected]> | ||
* Denis Roussel <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
TODO | ||
- You can use the `Scan` action in Shopfloor with a GS1 barcode. The |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from . import test_utils | ||
from . import test_action_search | ||
from . import test_scan_anything | ||
from . import test_action_search_hri |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Copyright 2022 Camptocamp SA (http://www.camptocamp.com) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from odoo.addons.shopfloor.tests.test_actions_search import TestSearchBaseCase | ||
|
||
from .common import ( | ||
GS1_GTIN_BARCODE_1_HRI, | ||
GS1_MANUF_BARCODE_HRI, | ||
LOT1, | ||
MANUF_CODE, | ||
PROD_BARCODE, | ||
) | ||
|
||
|
||
class TestFindHri(TestSearchBaseCase): | ||
@classmethod | ||
def setUpClassBaseData(cls): | ||
# pylint: disable=missing-return | ||
super().setUpClassBaseData() | ||
cls.product_a.barcode = PROD_BARCODE | ||
|
||
def test_find_picking(self): | ||
ptype = self.env.ref("shopfloor.picking_type_single_pallet_transfer_demo") | ||
rec = self._create_picking(picking_type=ptype) | ||
res = self.search.find(rec.name, types=("picking",)) | ||
self.assertEqual(res.record, rec) | ||
|
||
def test_find_location(self): | ||
rec = self.customer_location | ||
barcode = GS1_GTIN_BARCODE_1_HRI + "(254)" + rec.name | ||
res = self.search.find(barcode, types=("location",)) | ||
self.assertEqual(res.record, rec) | ||
res = self.search.find(rec.name, types=("location",)) | ||
self.assertEqual(res.record, rec) | ||
|
||
def test_find_package(self): | ||
rec = self.env["stock.quant.package"].sudo().create({"name": "ABC1234"}) | ||
res = self.search.find(rec.name, types=("package",)) | ||
self.assertEqual(res.record, rec) | ||
|
||
def test_find_product(self): | ||
rec = self.product_a | ||
res = self.search.find(GS1_GTIN_BARCODE_1_HRI, types=("product",)) | ||
self.assertEqual(res.record, rec) | ||
rec.barcode = MANUF_CODE | ||
res = self.search.find(GS1_MANUF_BARCODE_HRI, types=("product",)) | ||
self.assertEqual(res.record, rec) | ||
|
||
def test_find_lot(self): | ||
rec = ( | ||
self.env["stock.lot"] | ||
.sudo() | ||
.create( | ||
{ | ||
"product_id": self.product_a.id, | ||
"company_id": self.env.company.id, | ||
"name": LOT1, | ||
} | ||
) | ||
) | ||
res = self.search.find( | ||
GS1_GTIN_BARCODE_1_HRI, | ||
types=("lot",), | ||
handler_kw=dict(lot=dict(products=self.product_a)), | ||
) | ||
self.assertEqual(res.record, rec) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters