odoo-addon-shopfloor 16.0.2.11.0__py3-none-any.whl → 16.0.2.12.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ Shopfloor
11
11
  !! This file is generated by oca-gen-addon-readme !!
12
12
  !! changes will be overwritten. !!
13
13
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14
- !! source digest: sha256:45e38752c97272a2846012a4dfd2597a7df126607d2ec7e5ff0489e3477b63a5
14
+ !! source digest: sha256:c418f1851f7591fa3b9cde9ce01a2a3507baf0066f7453d93cfea051273d85fc
15
15
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16
16
 
17
17
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -6,7 +6,7 @@
6
6
  {
7
7
  "name": "Shopfloor",
8
8
  "summary": "manage warehouse operations with barcode scanners",
9
- "version": "16.0.2.11.0",
9
+ "version": "16.0.2.12.0",
10
10
  "development_status": "Beta",
11
11
  "category": "Inventory",
12
12
  "website": "https://github.com/OCA/wms",
@@ -1,3 +1,4 @@
1
+ from . import barcode_parser
1
2
  from . import change_package_lot
2
3
  from . import data
3
4
  from . import data_detail
@@ -0,0 +1,44 @@
1
+ # Copyright 2025 ACSONE SA/NV (https://www.acsone.eu)
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
3
+
4
+ from odoo.addons.component.core import Component
5
+
6
+ from ..actions.search import SearchAction
7
+
8
+
9
+ class BarcodeResult:
10
+
11
+ __slots__ = ("type", "value", "raw")
12
+
13
+ def __init__(self, **kw) -> None:
14
+ for k in self.__slots__:
15
+ setattr(self, k, kw.get(k))
16
+
17
+
18
+ class BarcodeParser(Component):
19
+ """
20
+ Some barcodes can have complex data structure
21
+ """
22
+
23
+ _name = "shopfloor.barcode.parser"
24
+ _inherit = "shopfloor.process.action"
25
+ _usage = "barcode"
26
+
27
+ def __init__(self, search_action: SearchAction):
28
+ # Get search action keys
29
+ self.search_action = search_action
30
+
31
+ @property
32
+ def _authorized_barcode_types(self):
33
+ return self.search_action._barcode_type_handler.keys()
34
+
35
+ def parse(self, barcode, types) -> list[BarcodeResult]:
36
+ """
37
+ This method will parse the barcode and return the
38
+ value with its type if determined.
39
+
40
+ Override this to implement specific parsing
41
+
42
+ """
43
+
44
+ return [BarcodeResult(type="unknown", value=barcode, raw=barcode)]
@@ -8,7 +8,8 @@ from odoo.addons.component.core import Component
8
8
 
9
9
 
10
10
  class SearchResult:
11
- __slots__ = ("record", "type", "code")
11
+
12
+ __slots__ = ("record", "type", "code", "parse_result")
12
13
 
13
14
  def __init__(self, **kw) -> None:
14
15
  for k in self.__slots__:
@@ -44,6 +45,12 @@ class SearchAction(Component):
44
45
 
45
46
  _inherit = "shopfloor.search.action"
46
47
 
48
+ @property
49
+ def parser(self):
50
+ parser = self._actions_for("barcode")
51
+ parser.search_action = self
52
+ return parser
53
+
47
54
  @property
48
55
  def _barcode_type_handler(self):
49
56
  return {
@@ -57,6 +64,8 @@ class SearchAction(Component):
57
64
  "packaging": self.packaging_from_scan,
58
65
  "delivery_packaging": self.delivery_packaging_from_scan,
59
66
  "origin_move": self.origin_move_from_scan,
67
+ # Extra data can be contained in barcodes
68
+ "expiration_date": self.expiration_date_from_scan,
60
69
  }
61
70
 
62
71
  def _make_search_result(self, **kwargs):
@@ -85,11 +94,20 @@ class SearchAction(Component):
85
94
  def generic_find(self, barcode, types=None, handler_kw=None):
86
95
  _types = types or self._barcode_type_handler.keys()
87
96
  # TODO: decide the best default order in case we don't pass `types`
88
- for btype in _types:
89
- record = self._find_record_by_type(barcode, btype, handler_kw)
90
- if record:
91
- return self._make_search_result(record=record, code=barcode, type=btype)
92
- return self._make_search_result(type="none")
97
+ parse_results = self.parser.parse(barcode, types)
98
+ for parse_result in parse_results:
99
+ for btype in _types:
100
+ record = self._find_record_by_type(
101
+ parse_result.value, btype, handler_kw
102
+ )
103
+ if record:
104
+ return self._make_search_result(
105
+ record=record,
106
+ code=barcode,
107
+ type=btype,
108
+ parse_result=parse_results,
109
+ )
110
+ return self._make_search_result(type="none", parse_result=parse_results)
93
111
 
94
112
  def location_from_scan(self, barcode, limit=1):
95
113
  model = self.env["stock.location"]
@@ -188,3 +206,10 @@ class SearchAction(Component):
188
206
  if extra_domain:
189
207
  outgoing_move_domain = AND([outgoing_move_domain, extra_domain])
190
208
  return model.search(outgoing_move_domain)
209
+
210
+ def dummy_from_scan(self, barcode):
211
+ return None
212
+
213
+ def expiration_date_from_scan(self, barcode):
214
+ # TODO
215
+ return None
@@ -372,7 +372,7 @@ ul.auto-toc {
372
372
  !! This file is generated by oca-gen-addon-readme !!
373
373
  !! changes will be overwritten. !!
374
374
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375
- !! source digest: sha256:45e38752c97272a2846012a4dfd2597a7df126607d2ec7e5ff0489e3477b63a5
375
+ !! source digest: sha256:c418f1851f7591fa3b9cde9ce01a2a3507baf0066f7453d93cfea051273d85fc
376
376
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377
377
  <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/wms/tree/16.0/shopfloor"><img alt="OCA/wms" src="https://img.shields.io/badge/github-OCA%2Fwms-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/wms-16-0/wms-16-0-shopfloor"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/wms&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378
378
  <p>Shopfloor is a barcode scanner application for internal warehouse operations.</p>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-shopfloor
3
- Version: 16.0.2.11.0
3
+ Version: 16.0.2.12.0
4
4
  Summary: manage warehouse operations with barcode scanners
5
5
  Home-page: https://github.com/OCA/wms
6
6
  Author: Camptocamp, BCIM, Akretion, Odoo Community Association (OCA)
@@ -40,7 +40,7 @@ Shopfloor
40
40
  !! This file is generated by oca-gen-addon-readme !!
41
41
  !! changes will be overwritten. !!
42
42
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
43
- !! source digest: sha256:45e38752c97272a2846012a4dfd2597a7df126607d2ec7e5ff0489e3477b63a5
43
+ !! source digest: sha256:c418f1851f7591fa3b9cde9ce01a2a3507baf0066f7453d93cfea051273d85fc
44
44
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
45
45
 
46
46
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -1,9 +1,10 @@
1
- odoo/addons/shopfloor/README.rst,sha256=SD6Nm8JyCEqH0FWIypev8_qsuwz61bGsabtHftcROgk,5483
1
+ odoo/addons/shopfloor/README.rst,sha256=UgZDCz4HK5OOLW_5n4GsL2AarZ-ues_g1A0_eGrLIhc,5483
2
2
  odoo/addons/shopfloor/__init__.py,sha256=ke3RmZ7XkX-lz4S8NHAxNIEJ5_Nvj5bjBAqD-W-q73c,91
3
- odoo/addons/shopfloor/__manifest__.py,sha256=mJFLUuxmWbHC1AXldD_HZ915M0rmFbh71s7q1EVu7eo,2246
3
+ odoo/addons/shopfloor/__manifest__.py,sha256=SX-ZCT7UZrAlhaZxcKVH0h2dXnRHvEvpzE6zaVgxVnU,2246
4
4
  odoo/addons/shopfloor/exceptions.py,sha256=81KpIGVkuYRhA0cIuml4pg4G3izqkAAhLqoXZbUd4X8,197
5
5
  odoo/addons/shopfloor/utils.py,sha256=Be7J8Tu7ivOW4lpe8IjKxwqfTwfmK-ZkeFEavoYIIF4,375
6
- odoo/addons/shopfloor/actions/__init__.py,sha256=_yTf-NtaJmSylBJIoJJvKNYEI-wlqpyRw-S5eJRRzEM,400
6
+ odoo/addons/shopfloor/actions/__init__.py,sha256=HhwibjwfE3oe7vIJtiUV0I7L2Z1bmoaqi7R5dElWhS0,429
7
+ odoo/addons/shopfloor/actions/barcode_parser.py,sha256=ngj5moIL9r6LD9Yt7NsXNvX2JeJAXL3G2lVzKI0-Y7k,1164
7
8
  odoo/addons/shopfloor/actions/change_package_lot.py,sha256=-esK7FKHaXKGOwL8RON_yZCLwIEZWZqriHxtx99TO9k,7264
8
9
  odoo/addons/shopfloor/actions/completion_info.py,sha256=Q_wlx8VJHOPFZbwGrxHBYa-gt04ZAXBsRBGh0aLuRrk,1483
9
10
  odoo/addons/shopfloor/actions/data.py,sha256=TF02p2ksynxxOLnkAeqZWCcJVFOhRUQS45O4l5p-oNw,12856
@@ -16,7 +17,7 @@ odoo/addons/shopfloor/actions/packaging.py,sha256=uZxD1bisNS_8M5ZQAHuOz2MR6l26XH
16
17
  odoo/addons/shopfloor/actions/savepoint.py,sha256=bIpPUPg-2BbO8hz277kWnq4DP_cayhAB_v8Rp2mUHjg,1143
17
18
  odoo/addons/shopfloor/actions/schema.py,sha256=H_4HCaYB7HiqU35WO2NmHtOLJ087iFLbiJD4HdiHFjU,8555
18
19
  odoo/addons/shopfloor/actions/schema_detail.py,sha256=_xtm8ptRXAPBIMTyr8XKMQtogcjBudh-QRqKUZEEHGU,4968
19
- odoo/addons/shopfloor/actions/search.py,sha256=8AvMOyxUd9iY_Cb84TccW4i5EfvUhIBQzOiLN4Y1Bcw,6856
20
+ odoo/addons/shopfloor/actions/search.py,sha256=R2ZiugKCD6VekDGs_UZyrUI3AUCdJ387IZ4lco45A8w,7619
20
21
  odoo/addons/shopfloor/actions/stock.py,sha256=5TUJa--aFlD5Y_atRQvWzbzicUrnE8CHd4v6xuZg6dY,11109
21
22
  odoo/addons/shopfloor/actions/stock_unreserve.py,sha256=P0a9V53MqG4sDln8yX0Id-nEXz7cydiFY_BBznioQpg,3090
22
23
  odoo/addons/shopfloor/components/__init__.py,sha256=a3ox1WOD1JhrQUrYMRn-yDJI0Vvc7ciKdmXuZB29ToU,173
@@ -85,7 +86,7 @@ odoo/addons/shopfloor/services/zone_picking.py,sha256=9GFw2AKBFFci8Erb8UyTAYuCI9
85
86
  odoo/addons/shopfloor/services/forms/__init__.py,sha256=nxwJdKX47hb56ERf4Qb3UE5dkdsHCbkaXMAXs4XMAd8,27
86
87
  odoo/addons/shopfloor/services/forms/picking_form.py,sha256=F15G5yw78Pd1WgPjMz00-K1JyGaTdfdvVYzG4Dubpqk,2626
87
88
  odoo/addons/shopfloor/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
88
- odoo/addons/shopfloor/static/description/index.html,sha256=fj3jFK6gLAvCtRo21aKnQr0S9S1_ctjXJBaV_WwoGDI,17775
89
+ odoo/addons/shopfloor/static/description/index.html,sha256=G43IO-oa2cGIv7agAu0lFpVbC53uYGa95I1LP8lkfUM,17775
89
90
  odoo/addons/shopfloor/tests/__init__.py,sha256=4WHuLVjOX_lndDJyuyGcreNckArFJL2HA5PPFlhT6FM,3962
90
91
  odoo/addons/shopfloor/tests/common.py,sha256=nU-1CYbAi2hoI2jFIcw6udgl1ave_IGJciyOZ9DeiAE,11610
91
92
  odoo/addons/shopfloor/tests/models.py,sha256=PWNPC6DgFMbrarojSxUqwycnBdePX-4Q5Z0rn1WwQqY,940
@@ -187,7 +188,7 @@ odoo/addons/shopfloor/views/shopfloor_menu.xml,sha256=rKXjj0Jk8gjda1y1B6d1_s3sn0
187
188
  odoo/addons/shopfloor/views/stock_location.xml,sha256=d7iqbOQZbb5YPSdAXlQ6spcj8dUvQ37DpEGuaLX5B1M,829
188
189
  odoo/addons/shopfloor/views/stock_move_line.xml,sha256=tn3pV67aRoYmn3qkm3aSgdYArY-z9SIrl_4fpJFy3Jo,1984
189
190
  odoo/addons/shopfloor/views/stock_picking_type.xml,sha256=Ckn2835hO4HtuZQX9x3382C4gs789fb94Cx0444mBkc,800
190
- odoo_addon_shopfloor-16.0.2.11.0.dist-info/METADATA,sha256=LwYhRbtI0CZnKnLFTokY5mjFl4hsajNPSGVGv6_1f-4,6927
191
- odoo_addon_shopfloor-16.0.2.11.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
192
- odoo_addon_shopfloor-16.0.2.11.0.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
193
- odoo_addon_shopfloor-16.0.2.11.0.dist-info/RECORD,,
191
+ odoo_addon_shopfloor-16.0.2.12.0.dist-info/METADATA,sha256=dF9chlSU77c5UiwWQQ8YipWPOdPCZHg5I_81NKfxF3A,6927
192
+ odoo_addon_shopfloor-16.0.2.12.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
193
+ odoo_addon_shopfloor-16.0.2.12.0.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
194
+ odoo_addon_shopfloor-16.0.2.12.0.dist-info/RECORD,,