odoo-addon-shopfloor 16.0.1.0.0.24__py3-none-any.whl → 16.0.2.1.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.
Files changed (76) hide show
  1. odoo/addons/shopfloor/README.rst +1 -1
  2. odoo/addons/shopfloor/__manifest__.py +1 -1
  3. odoo/addons/shopfloor/actions/data.py +69 -34
  4. odoo/addons/shopfloor/actions/data_detail.py +20 -0
  5. odoo/addons/shopfloor/actions/message.py +94 -2
  6. odoo/addons/shopfloor/actions/move_line_search.py +2 -2
  7. odoo/addons/shopfloor/actions/packaging.py +10 -0
  8. odoo/addons/shopfloor/actions/schema.py +11 -0
  9. odoo/addons/shopfloor/actions/schema_detail.py +14 -8
  10. odoo/addons/shopfloor/actions/search.py +9 -6
  11. odoo/addons/shopfloor/components/scan_handler_product.py +2 -0
  12. odoo/addons/shopfloor/data/shopfloor_scenario_data.xml +4 -2
  13. odoo/addons/shopfloor/docs/checkout_diag_seq.plantuml +19 -5
  14. odoo/addons/shopfloor/docs/checkout_diag_seq.png +0 -0
  15. odoo/addons/shopfloor/docs/single_pack_transfer_diag_seq.plantuml +4 -4
  16. odoo/addons/shopfloor/docs/single_pack_transfer_diag_seq.png +0 -0
  17. odoo/addons/shopfloor/i18n/ca.po +26 -8
  18. odoo/addons/shopfloor/i18n/de.po +26 -8
  19. odoo/addons/shopfloor/i18n/es_AR.po +36 -10
  20. odoo/addons/shopfloor/i18n/it.po +2015 -0
  21. odoo/addons/shopfloor/i18n/pt_BR.po +26 -8
  22. odoo/addons/shopfloor/i18n/shopfloor.pot +133 -8
  23. odoo/addons/shopfloor/migrations/16.0.2.0.0/post-migration.py +43 -0
  24. odoo/addons/shopfloor/models/shopfloor_menu.py +29 -5
  25. odoo/addons/shopfloor/models/stock_move_line.py +3 -0
  26. odoo/addons/shopfloor/models/stock_picking.py +11 -0
  27. odoo/addons/shopfloor/services/checkout.py +216 -61
  28. odoo/addons/shopfloor/services/cluster_picking.py +33 -18
  29. odoo/addons/shopfloor/services/delivery.py +25 -7
  30. odoo/addons/shopfloor/services/location_content_transfer.py +42 -28
  31. odoo/addons/shopfloor/services/single_pack_transfer.py +36 -13
  32. odoo/addons/shopfloor/services/zone_picking.py +187 -67
  33. odoo/addons/shopfloor/static/description/index.html +1 -1
  34. odoo/addons/shopfloor/tests/__init__.py +2 -0
  35. odoo/addons/shopfloor/tests/common.py +3 -1
  36. odoo/addons/shopfloor/tests/test_actions_data.py +46 -7
  37. odoo/addons/shopfloor/tests/test_actions_data_base.py +15 -0
  38. odoo/addons/shopfloor/tests/test_actions_data_detail.py +30 -8
  39. odoo/addons/shopfloor/tests/test_actions_packaging.py +43 -0
  40. odoo/addons/shopfloor/tests/test_checkout_base.py +15 -5
  41. odoo/addons/shopfloor/tests/test_checkout_done.py +40 -5
  42. odoo/addons/shopfloor/tests/test_checkout_list_delivery_packaging.py +1 -0
  43. odoo/addons/shopfloor/tests/test_checkout_list_package.py +3 -1
  44. odoo/addons/shopfloor/tests/test_checkout_scan.py +19 -0
  45. odoo/addons/shopfloor/tests/test_checkout_scan_dest_location.py +99 -0
  46. odoo/addons/shopfloor/tests/test_checkout_scan_line.py +3 -2
  47. odoo/addons/shopfloor/tests/test_checkout_scan_line_no_prefill_qty.py +48 -0
  48. odoo/addons/shopfloor/tests/test_checkout_scan_package_action.py +26 -0
  49. odoo/addons/shopfloor/tests/test_checkout_scan_package_action_no_prefill_qty.py +16 -0
  50. odoo/addons/shopfloor/tests/test_checkout_select_package_base.py +4 -1
  51. odoo/addons/shopfloor/tests/test_checkout_summary.py +1 -1
  52. odoo/addons/shopfloor/tests/test_cluster_picking_unload.py +37 -8
  53. odoo/addons/shopfloor/tests/test_delivery_list_stock_picking.py +5 -0
  54. odoo/addons/shopfloor/tests/test_location_content_transfer_base.py +4 -4
  55. odoo/addons/shopfloor/tests/test_location_content_transfer_set_destination_all.py +24 -2
  56. odoo/addons/shopfloor/tests/test_location_content_transfer_set_destination_package_or_line.py +6 -4
  57. odoo/addons/shopfloor/tests/test_location_content_transfer_single.py +45 -0
  58. odoo/addons/shopfloor/tests/test_scan_anything.py +7 -0
  59. odoo/addons/shopfloor/tests/test_single_pack_transfer.py +59 -8
  60. odoo/addons/shopfloor/tests/test_zone_picking_base.py +36 -10
  61. odoo/addons/shopfloor/tests/test_zone_picking_change_pack_lot.py +2 -0
  62. odoo/addons/shopfloor/tests/test_zone_picking_complete_mix_pack_flux.py +59 -0
  63. odoo/addons/shopfloor/tests/test_zone_picking_select_line.py +33 -2
  64. odoo/addons/shopfloor/tests/test_zone_picking_select_line_first_scan_location.py +8 -3
  65. odoo/addons/shopfloor/tests/test_zone_picking_select_line_no_prefill_qty.py +19 -2
  66. odoo/addons/shopfloor/tests/test_zone_picking_set_line_destination.py +88 -19
  67. odoo/addons/shopfloor/tests/test_zone_picking_set_line_destination_package_not_allowed.py +94 -0
  68. odoo/addons/shopfloor/tests/test_zone_picking_set_line_destination_pick_pack.py +1 -5
  69. odoo/addons/shopfloor/tests/test_zone_picking_start.py +4 -4
  70. odoo/addons/shopfloor/tests/test_zone_picking_unload_all.py +1 -1
  71. odoo/addons/shopfloor/tests/test_zone_picking_unload_set_destination.py +4 -4
  72. odoo/addons/shopfloor/views/shopfloor_menu.xml +30 -0
  73. {odoo_addon_shopfloor-16.0.1.0.0.24.dist-info → odoo_addon_shopfloor-16.0.2.1.0.dist-info}/METADATA +2 -2
  74. {odoo_addon_shopfloor-16.0.1.0.0.24.dist-info → odoo_addon_shopfloor-16.0.2.1.0.dist-info}/RECORD +76 -70
  75. {odoo_addon_shopfloor-16.0.1.0.0.24.dist-info → odoo_addon_shopfloor-16.0.2.1.0.dist-info}/WHEEL +0 -0
  76. {odoo_addon_shopfloor-16.0.1.0.0.24.dist-info → odoo_addon_shopfloor-16.0.2.1.0.dist-info}/top_level.txt +0 -0
@@ -893,6 +893,12 @@ msgstr ""
893
893
  msgid "Packaging not found in the current transfer."
894
894
  msgstr ""
895
895
 
896
+ #. module: shopfloor
897
+ #: code:addons/shopfloor/actions/message.py:0
898
+ #, python-format
899
+ msgid "Packaging {} dimension updated."
900
+ msgstr ""
901
+
896
902
  #. module: shopfloor
897
903
  #: code:addons/shopfloor/actions/message.py:0
898
904
  #, python-format
@@ -1059,6 +1065,11 @@ msgstr ""
1059
1065
  msgid "Restart the operation, someone has canceled it."
1060
1066
  msgstr ""
1061
1067
 
1068
+ #. module: shopfloor
1069
+ #: model:ir.model.fields,field_description:shopfloor.field_shopfloor_menu__scan_location_or_pack_first
1070
+ msgid "Restrict scannable barcode at work selection"
1071
+ msgstr ""
1072
+
1062
1073
  #. module: shopfloor
1063
1074
  #: model_terms:ir.ui.view,arch_db:shopfloor.view_stock_move_line_detailed_operation_tree
1064
1075
  msgid "SF Priority"
@@ -1090,11 +1101,6 @@ msgstr ""
1090
1101
  msgid "Scan Location Or Pack First Is Possible"
1091
1102
  msgstr ""
1092
1103
 
1093
- #. module: shopfloor
1094
- #: model:ir.model.fields,field_description:shopfloor.field_shopfloor_menu__scan_location_or_pack_first
1095
- msgid "Scan first location or pack"
1096
- msgstr ""
1097
-
1098
1104
  #. module: shopfloor
1099
1105
  #: code:addons/shopfloor/actions/message.py:0
1100
1106
  #, python-format
@@ -1634,6 +1640,18 @@ msgid ""
1634
1640
  "with the remaining lines."
1635
1641
  msgstr ""
1636
1642
 
1643
+ #. module: shopfloor
1644
+ #: model:ir.model.fields,help:shopfloor.field_shopfloor_menu__scan_location_or_pack_first
1645
+ msgid ""
1646
+ "When checked, the user will be restricted by the type of object barcode "
1647
+ "that he can scan to select the document/transfer/move line to work on."
1648
+ msgstr ""
1649
+
1650
+ #. module: shopfloor
1651
+ #: model_terms:ir.ui.view,arch_db:shopfloor.shopfloor_menu_form_view
1652
+ msgid "When choosing an order to pack, do not allow to scan a product."
1653
+ msgstr ""
1654
+
1637
1655
  #. module: shopfloor
1638
1656
  #: model:ir.model.fields,help:shopfloor.field_shopfloor_menu__allow_get_work
1639
1657
  msgid ""
@@ -1653,10 +1671,10 @@ msgid "When picking, prevent unloading the whole bin when full."
1653
1671
  msgstr ""
1654
1672
 
1655
1673
  #. module: shopfloor
1656
- #: model:ir.model.fields,help:shopfloor.field_shopfloor_menu__scan_location_or_pack_first
1674
+ #: model_terms:ir.ui.view,arch_db:shopfloor.shopfloor_menu_form_view
1657
1675
  msgid ""
1658
- "When selecting work, force the user to first scan a location or pack,then "
1659
- "the product or lot."
1676
+ "When selecting a move line, force the user to first scan a package or a "
1677
+ "location and not a product or a lot."
1660
1678
  msgstr ""
1661
1679
 
1662
1680
  #. module: shopfloor
@@ -45,6 +45,16 @@ msgid ""
45
45
  "decreasing the delivered quantity of the related SO line.\n"
46
46
  msgstr ""
47
47
 
48
+ #. module: shopfloor
49
+ #: model:ir.model.fields,help:shopfloor.field_shopfloor_menu__allow_alternative_destination_package
50
+ msgid ""
51
+ "\n"
52
+ "When moving a whole package, the user normally scans\n"
53
+ "a destination location.\n"
54
+ "If enabled, they will also be allowed\n"
55
+ "to scan a destination package.\n"
56
+ msgstr ""
57
+
48
58
  #. module: shopfloor
49
59
  #: model:ir.model.fields,help:shopfloor.field_shopfloor_menu__multiple_move_single_pack
50
60
  msgid ""
@@ -134,6 +144,11 @@ msgstr ""
134
144
  msgid "Allow Alternative Destination Is Possible"
135
145
  msgstr ""
136
146
 
147
+ #. module: shopfloor
148
+ #: model:ir.model.fields,field_description:shopfloor.field_shopfloor_menu__allow_alternative_destination_package_is_possible
149
+ msgid "Allow Alternative Destination Package Is Possible"
150
+ msgstr ""
151
+
137
152
  #. module: shopfloor
138
153
  #: model:ir.model.fields,field_description:shopfloor.field_shopfloor_menu__allow_force_reservation_is_possible
139
154
  msgid "Allow Force Reservation Is Possible"
@@ -159,6 +174,11 @@ msgstr ""
159
174
  msgid "Allow create returns"
160
175
  msgstr ""
161
176
 
177
+ #. module: shopfloor
178
+ #: model:ir.model.fields,field_description:shopfloor.field_shopfloor_menu__allow_alternative_destination_package
179
+ msgid "Allow to change the destination package"
180
+ msgstr ""
181
+
162
182
  #. module: shopfloor
163
183
  #: model:ir.model.fields,field_description:shopfloor.field_shopfloor_menu__allow_unreserve_other_moves
164
184
  msgid "Allow to process reserved quantities"
@@ -325,6 +345,11 @@ msgid ""
325
345
  "the same package."
326
346
  msgstr ""
327
347
 
348
+ #. module: shopfloor
349
+ #: model:ir.model.fields,field_description:shopfloor.field_stock_move_line__result_package_id
350
+ msgid "Destination Package"
351
+ msgstr ""
352
+
328
353
  #. module: shopfloor
329
354
  #: model:ir.model.fields,field_description:shopfloor.field_shopfloor_menu__disable_full_bin_action_is_possible
330
355
  msgid "Disable Full Bin Action Is Possible"
@@ -370,6 +395,11 @@ msgstr ""
370
395
  msgid "Goods packed into {0.name}"
371
396
  msgstr ""
372
397
 
398
+ #. module: shopfloor
399
+ #: model:ir.model.fields,help:shopfloor.field_stock_move_line__result_package_id
400
+ msgid "If set, the operations are packed into this package"
401
+ msgstr ""
402
+
373
403
  #. module: shopfloor
374
404
  #: model:ir.model.fields,help:shopfloor.field_shopfloor_menu__ignore_no_putaway_available
375
405
  msgid ""
@@ -469,6 +499,20 @@ msgstr ""
469
499
  msgid "Location {} empty"
470
500
  msgstr ""
471
501
 
502
+ #. module: shopfloor
503
+ #. odoo-python
504
+ #: code:addons/shopfloor/actions/message.py:0
505
+ #, python-format
506
+ msgid "Lot %(lot_name)s not found in location %(location_name)s"
507
+ msgstr ""
508
+
509
+ #. module: shopfloor
510
+ #. odoo-python
511
+ #: code:addons/shopfloor/actions/message.py:0
512
+ #, python-format
513
+ msgid "Lot %(lot_name)s not found in transfer %(picking_name)s"
514
+ msgstr ""
515
+
472
516
  #. module: shopfloor
473
517
  #. odoo-python
474
518
  #: code:addons/shopfloor/actions/message.py:0
@@ -600,6 +644,13 @@ msgstr ""
600
644
  msgid "No line to pack found."
601
645
  msgstr ""
602
646
 
647
+ #. module: shopfloor
648
+ #. odoo-python
649
+ #: code:addons/shopfloor/actions/message.py:0
650
+ #, python-format
651
+ msgid "No lines to process, set quantities on some"
652
+ msgstr ""
653
+
603
654
  #. module: shopfloor
604
655
  #. odoo-python
605
656
  #: code:addons/shopfloor/actions/message.py:0
@@ -798,6 +849,15 @@ msgstr ""
798
849
  msgid "Package %(package_name)s cannot be used: %(error)s"
799
850
  msgstr ""
800
851
 
852
+ #. module: shopfloor
853
+ #. odoo-python
854
+ #: code:addons/shopfloor/actions/message.py:0
855
+ #, python-format
856
+ msgid ""
857
+ "Package %(package_name)s contains already lines from a different operation "
858
+ "type %(picking_type_name)s."
859
+ msgstr ""
860
+
801
861
  #. module: shopfloor
802
862
  #. odoo-python
803
863
  #: code:addons/shopfloor/models/stock_move_line.py:0
@@ -815,6 +875,20 @@ msgid ""
815
875
  "Package %(package_name)s is not available in transfer %(picking_name)s."
816
876
  msgstr ""
817
877
 
878
+ #. module: shopfloor
879
+ #. odoo-python
880
+ #: code:addons/shopfloor/actions/message.py:0
881
+ #, python-format
882
+ msgid "Package %(package_name)s not found in location %(location_name)s"
883
+ msgstr ""
884
+
885
+ #. module: shopfloor
886
+ #. odoo-python
887
+ #: code:addons/shopfloor/actions/message.py:0
888
+ #, python-format
889
+ msgid "Package %(package_name)s not found in transfer %(picking_name)s"
890
+ msgstr ""
891
+
818
892
  #. module: shopfloor
819
893
  #: model:ir.model.fields,field_description:shopfloor.field_stock_picking__package_level_count
820
894
  msgid "Package Level Count"
@@ -911,6 +985,13 @@ msgstr ""
911
985
  msgid "Packaging not found in the current transfer."
912
986
  msgstr ""
913
987
 
988
+ #. module: shopfloor
989
+ #. odoo-python
990
+ #: code:addons/shopfloor/actions/message.py:0
991
+ #, python-format
992
+ msgid "Packaging {} dimension updated."
993
+ msgstr ""
994
+
914
995
  #. module: shopfloor
915
996
  #. odoo-python
916
997
  #: code:addons/shopfloor/actions/message.py:0
@@ -1017,6 +1098,15 @@ msgstr ""
1017
1098
  msgid "Processing reserved quantities is not allowed for menu {}."
1018
1099
  msgstr ""
1019
1100
 
1101
+ #. module: shopfloor
1102
+ #. odoo-python
1103
+ #: code:addons/shopfloor/actions/message.py:0
1104
+ #, python-format
1105
+ msgid ""
1106
+ "Product %(product_name)s not found in location %(location_name)s or transfer"
1107
+ " %(picking_name)s."
1108
+ msgstr ""
1109
+
1020
1110
  #. module: shopfloor
1021
1111
  #: model:ir.model,name:shopfloor.model_stock_move_line
1022
1112
  msgid "Product Moves (Stock Move Line)"
@@ -1094,6 +1184,11 @@ msgstr ""
1094
1184
  msgid "Restart the operation, someone has canceled it."
1095
1185
  msgstr ""
1096
1186
 
1187
+ #. module: shopfloor
1188
+ #: model:ir.model.fields,field_description:shopfloor.field_shopfloor_menu__scan_location_or_pack_first
1189
+ msgid "Restrict scannable barcode at work selection"
1190
+ msgstr ""
1191
+
1097
1192
  #. module: shopfloor
1098
1193
  #: model_terms:ir.ui.view,arch_db:shopfloor.view_stock_move_line_detailed_operation_tree
1099
1194
  msgid "SF Priority"
@@ -1126,11 +1221,6 @@ msgstr ""
1126
1221
  msgid "Scan Location Or Pack First Is Possible"
1127
1222
  msgstr ""
1128
1223
 
1129
- #. module: shopfloor
1130
- #: model:ir.model.fields,field_description:shopfloor.field_shopfloor_menu__scan_location_or_pack_first
1131
- msgid "Scan first location or pack"
1132
- msgstr ""
1133
-
1134
1224
  #. module: shopfloor
1135
1225
  #. odoo-python
1136
1226
  #: code:addons/shopfloor/actions/message.py:0
@@ -1421,6 +1511,13 @@ msgstr ""
1421
1511
  msgid "The content of {} cannot be transferred with this scenario."
1422
1512
  msgstr ""
1423
1513
 
1514
+ #. module: shopfloor
1515
+ #. odoo-python
1516
+ #: code:addons/shopfloor/models/stock_move_line.py:0
1517
+ #, python-format
1518
+ msgid "The demand cannot be negative"
1519
+ msgstr ""
1520
+
1424
1521
  #. module: shopfloor
1425
1522
  #. odoo-python
1426
1523
  #: code:addons/shopfloor/services/cluster_picking.py:0
@@ -1671,6 +1768,15 @@ msgstr ""
1671
1768
  msgid "Transfer {} is not available."
1672
1769
  msgstr ""
1673
1770
 
1771
+ #. module: shopfloor
1772
+ #. odoo-python
1773
+ #: code:addons/shopfloor/actions/message.py:0
1774
+ #, python-format
1775
+ msgid ""
1776
+ "Transferring to a different package is not allowed, please scan a location "
1777
+ "instead."
1778
+ msgstr ""
1779
+
1674
1780
  #. module: shopfloor
1675
1781
  #. odoo-python
1676
1782
  #: code:addons/shopfloor/actions/message.py:0
@@ -1728,6 +1834,18 @@ msgid ""
1728
1834
  "with the remaining lines."
1729
1835
  msgstr ""
1730
1836
 
1837
+ #. module: shopfloor
1838
+ #: model:ir.model.fields,help:shopfloor.field_shopfloor_menu__scan_location_or_pack_first
1839
+ msgid ""
1840
+ "When checked, the user will be restricted by the type of object barcode "
1841
+ "that he can scan to select the document/transfer/move line to work on."
1842
+ msgstr ""
1843
+
1844
+ #. module: shopfloor
1845
+ #: model_terms:ir.ui.view,arch_db:shopfloor.shopfloor_menu_form_view
1846
+ msgid "When choosing an order to pack, do not allow to scan a product."
1847
+ msgstr ""
1848
+
1731
1849
  #. module: shopfloor
1732
1850
  #: model:ir.model.fields,help:shopfloor.field_shopfloor_menu__allow_get_work
1733
1851
  msgid ""
@@ -1747,10 +1865,10 @@ msgid "When picking, prevent unloading the whole bin when full."
1747
1865
  msgstr ""
1748
1866
 
1749
1867
  #. module: shopfloor
1750
- #: model:ir.model.fields,help:shopfloor.field_shopfloor_menu__scan_location_or_pack_first
1868
+ #: model_terms:ir.ui.view,arch_db:shopfloor.shopfloor_menu_form_view
1751
1869
  msgid ""
1752
- "When selecting work, force the user to first scan a location or pack,then "
1753
- "the product or lot."
1870
+ "When selecting a move line, force the user to first scan a package or a "
1871
+ "location and not a product or a lot."
1754
1872
  msgstr ""
1755
1873
 
1756
1874
  #. module: shopfloor
@@ -1823,6 +1941,13 @@ msgstr ""
1823
1941
  msgid "You cannot place it here"
1824
1942
  msgstr ""
1825
1943
 
1944
+ #. module: shopfloor
1945
+ #. odoo-python
1946
+ #: code:addons/shopfloor/actions/message.py:0
1947
+ #, python-format
1948
+ msgid "You cannot process that much units."
1949
+ msgstr ""
1950
+
1826
1951
  #. module: shopfloor
1827
1952
  #. odoo-python
1828
1953
  #: code:addons/shopfloor/actions/message.py:0
@@ -0,0 +1,43 @@
1
+ # Copyright 2023 Camptocamp SA (http://www.camptocamp.com)
2
+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3
+
4
+ import json
5
+ import logging
6
+
7
+ from odoo import SUPERUSER_ID, api
8
+
9
+ _logger = logging.getLogger(__name__)
10
+
11
+
12
+ def migrate(cr, version):
13
+ if not version:
14
+ return
15
+ env = api.Environment(cr, SUPERUSER_ID, {})
16
+ zone_picking_scenario = env["shopfloor.scenario"].search(
17
+ [("name", "=", "Zone Picking")]
18
+ )
19
+ _update_scenario_options(zone_picking_scenario)
20
+ zone_picking_menus = env["shopfloor.menu"].search(
21
+ [("scenario_id", "=", zone_picking_scenario.id)]
22
+ )
23
+ _enable_option_in_menus(zone_picking_menus)
24
+
25
+
26
+ def _update_scenario_options(scenario):
27
+ options = scenario.options
28
+ options["allow_alternative_destination_package"] = True
29
+ options_edit = json.dumps(options or {}, indent=4, sort_keys=True)
30
+ scenario.write({"options_edit": options_edit})
31
+ _logger.info(
32
+ "Option allow_alternative_destination_package added to scenario Zone Picking"
33
+ )
34
+
35
+
36
+ def _enable_option_in_menus(menus):
37
+ for menu in menus:
38
+ menu.allow_alternative_destination_package = True
39
+ _logger.info(
40
+ "Option allow_alternative_destination_package enabled for menu {}".format(
41
+ menu.name
42
+ )
43
+ )
@@ -33,7 +33,7 @@ by scanning a product or product packaging EAN to increase the quantity
33
33
  (i.e. +1 Unit or +1 Box)
34
34
  """
35
35
 
36
- AUTO_POST_LINE = """
36
+ AUTO_POST_LINE_HELP = """
37
37
  When setting result pack & destination,
38
38
  automatically post the corresponding line
39
39
  if this option is checked.
@@ -46,6 +46,13 @@ A new move will be added as a return of the delivery,
46
46
  decreasing the delivered quantity of the related SO line.
47
47
  """
48
48
 
49
+ ALLOW_ALTERNATIVE_DESTINATION_PACKAGE_HELP = """
50
+ When moving a whole package, the user normally scans
51
+ a destination location.
52
+ If enabled, they will also be allowed
53
+ to scan a destination package.
54
+ """
55
+
49
56
 
50
57
  class ShopfloorMenu(models.Model):
51
58
  _inherit = "shopfloor.menu"
@@ -171,11 +178,12 @@ class ShopfloorMenu(models.Model):
171
178
  show_oneline_package_content_is_possible = fields.Boolean(
172
179
  compute="_compute_show_oneline_package_content_is_possible"
173
180
  )
181
+ # TODO this field could be renamed
174
182
  scan_location_or_pack_first = fields.Boolean(
175
- string="Scan first location or pack",
183
+ string="Restrict scannable barcode at work selection",
176
184
  help=(
177
- "When selecting work, force the user to first scan a location or pack,"
178
- "then the product or lot."
185
+ "When checked, the user will be restricted by the type of object barcode "
186
+ " that he can scan to select the document/transfer/move line to work on."
179
187
  ),
180
188
  )
181
189
  scan_location_or_pack_first_is_possible = fields.Boolean(
@@ -205,11 +213,19 @@ class ShopfloorMenu(models.Model):
205
213
  auto_post_line = fields.Boolean(
206
214
  string="Automatically post line",
207
215
  default=False,
208
- help=AUTO_POST_LINE,
216
+ help=AUTO_POST_LINE_HELP,
209
217
  )
210
218
  auto_post_line_is_possible = fields.Boolean(
211
219
  compute="_compute_auto_post_line_is_possible"
212
220
  )
221
+ allow_alternative_destination_package = fields.Boolean(
222
+ string="Allow to change the destination package",
223
+ default=False,
224
+ help=ALLOW_ALTERNATIVE_DESTINATION_PACKAGE_HELP,
225
+ )
226
+ allow_alternative_destination_package_is_possible = fields.Boolean(
227
+ compute="_compute_allow_alternative_destination_package_is_possible"
228
+ )
213
229
 
214
230
  @api.onchange("unload_package_at_destination")
215
231
  def _onchange_unload_package_at_destination(self):
@@ -424,6 +440,7 @@ class ShopfloorMenu(models.Model):
424
440
  "auto_post_line"
425
441
  )
426
442
 
443
+ @api.depends("scenario_id")
427
444
  def _compute_allow_alternative_destination_is_possible(self):
428
445
  for menu in self:
429
446
  menu.allow_alternative_destination_is_possible = (
@@ -434,3 +451,10 @@ class ShopfloorMenu(models.Model):
434
451
  def _compute_allow_return_is_possible(self):
435
452
  for menu in self:
436
453
  menu.allow_return_is_possible = menu.scenario_id.has_option("allow_return")
454
+
455
+ @api.depends("scenario_id")
456
+ def _compute_allow_alternative_destination_package_is_possible(self):
457
+ for menu in self:
458
+ menu.allow_alternative_destination_package_is_possible = (
459
+ menu.scenario_id.has_option("allow_alternative_destination_package")
460
+ )
@@ -24,6 +24,7 @@ class StockMoveLine(models.Model):
24
24
  # we search lines based on their location in some workflows
25
25
  location_id = fields.Many2one(index=True)
26
26
  package_id = fields.Many2one(index=True)
27
+ result_package_id = fields.Many2one(index=True)
27
28
 
28
29
  # allow domain on picking_id.xxx without too much perf penalty
29
30
  picking_id = fields.Many2one(auto_join=True)
@@ -153,6 +154,8 @@ class StockMoveLine(models.Model):
153
154
  :param split_partial: split if qty is less than expected
154
155
  otherwise rely on a backorder.
155
156
  """
157
+ if self.reserved_uom_qty < 0:
158
+ raise UserError(_("The demand cannot be negative"))
156
159
  # store a new line if we have split our line (not enough qty)
157
160
  new_line = self.env["stock.move.line"]
158
161
  rounding = self.product_uom_id.rounding
@@ -116,3 +116,14 @@ class StockPicking(models.Model):
116
116
  )
117
117
  assigned_moves._action_assign()
118
118
  return new_picking.id
119
+
120
+ def _put_in_pack(self, move_line_ids, create_package_level=True):
121
+ """
122
+ Marks the corresponding move lines as 'shopfloor_checkout_done'
123
+ when the package is created in the backend.
124
+
125
+ """
126
+ new_package = super()._put_in_pack(move_line_ids, create_package_level)
127
+ lines = move_line_ids.filtered(lambda p: p.result_package_id == new_package)
128
+ lines.write({"shopfloor_checkout_done": True})
129
+ return new_package