odoo-addon-shopfloor 16.0.2.12.0.1__py3-none-any.whl → 18.0.0.1.0.15__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.
- odoo/addons/shopfloor/README.rst +79 -52
- odoo/addons/shopfloor/__manifest__.py +11 -4
- odoo/addons/shopfloor/actions/__init__.py +0 -1
- odoo/addons/shopfloor/actions/change_package_lot.py +4 -6
- odoo/addons/shopfloor/actions/data.py +7 -6
- odoo/addons/shopfloor/actions/inventory.py +1 -1
- odoo/addons/shopfloor/actions/message.py +1 -1
- odoo/addons/shopfloor/actions/move_line_search.py +1 -1
- odoo/addons/shopfloor/actions/search.py +8 -32
- odoo/addons/shopfloor/actions/stock.py +7 -6
- odoo/addons/shopfloor/i18n/ca.po +0 -5
- odoo/addons/shopfloor/i18n/de.po +0 -5
- odoo/addons/shopfloor/i18n/es_AR.po +0 -5
- odoo/addons/shopfloor/i18n/it.po +2 -8
- odoo/addons/shopfloor/i18n/pt_BR.po +0 -5
- odoo/addons/shopfloor/i18n/shopfloor.pot +7 -194
- odoo/addons/shopfloor/models/stock_location.py +5 -5
- odoo/addons/shopfloor/models/stock_move.py +24 -7
- odoo/addons/shopfloor/models/stock_move_line.py +29 -82
- odoo/addons/shopfloor/models/stock_picking.py +8 -6
- odoo/addons/shopfloor/models/stock_quant_package.py +2 -2
- odoo/addons/shopfloor/readme/CONTRIBUTORS.md +17 -0
- odoo/addons/shopfloor/readme/CREDITS.md +5 -0
- odoo/addons/shopfloor/readme/DESCRIPTION.md +37 -0
- odoo/addons/shopfloor/readme/{HISTORY.rst → HISTORY.md} +1 -2
- odoo/addons/shopfloor/readme/ROADMAP.md +10 -0
- odoo/addons/shopfloor/readme/USAGE.md +6 -0
- odoo/addons/shopfloor/services/checkout.py +9 -9
- odoo/addons/shopfloor/services/cluster_picking.py +2 -2
- odoo/addons/shopfloor/services/delivery.py +4 -6
- odoo/addons/shopfloor/services/forms/picking_form.py +4 -1
- odoo/addons/shopfloor/services/location_content_transfer.py +1 -1
- odoo/addons/shopfloor/services/single_pack_transfer.py +1 -1
- odoo/addons/shopfloor/services/zone_picking.py +5 -9
- odoo/addons/shopfloor/static/description/index.html +41 -18
- odoo/addons/shopfloor/tests/__init__.py +74 -73
- odoo/addons/shopfloor/tests/common.py +9 -9
- odoo/addons/shopfloor/tests/test_actions_change_package_lot.py +104 -71
- odoo/addons/shopfloor/tests/test_actions_data.py +17 -21
- odoo/addons/shopfloor/tests/test_actions_data_base.py +9 -3
- odoo/addons/shopfloor/tests/test_actions_data_detail.py +17 -19
- odoo/addons/shopfloor/tests/test_actions_search.py +2 -1
- odoo/addons/shopfloor/tests/test_actions_stock.py +0 -1
- odoo/addons/shopfloor/tests/test_checkout_auto_post.py +3 -3
- odoo/addons/shopfloor/tests/test_checkout_base.py +1 -1
- odoo/addons/shopfloor/tests/test_checkout_list_delivery_packaging.py +1 -1
- odoo/addons/shopfloor/tests/test_checkout_list_package.py +4 -4
- odoo/addons/shopfloor/tests/test_checkout_new_package.py +3 -3
- odoo/addons/shopfloor/tests/test_checkout_no_package.py +3 -3
- odoo/addons/shopfloor/tests/test_checkout_scan_dest_location.py +1 -1
- odoo/addons/shopfloor/tests/test_checkout_scan_package_action.py +11 -11
- odoo/addons/shopfloor/tests/test_checkout_select_package_base.py +1 -1
- odoo/addons/shopfloor/tests/test_checkout_set_qty.py +17 -17
- odoo/addons/shopfloor/tests/test_checkout_summary.py +2 -2
- odoo/addons/shopfloor/tests/test_cluster_picking_base.py +1 -1
- odoo/addons/shopfloor/tests/test_cluster_picking_batch.py +2 -2
- odoo/addons/shopfloor/tests/test_cluster_picking_change_pack_lot.py +1 -1
- odoo/addons/shopfloor/tests/test_cluster_picking_is_zero.py +1 -1
- odoo/addons/shopfloor/tests/test_cluster_picking_scan_destination.py +17 -19
- odoo/addons/shopfloor/tests/test_cluster_picking_scan_line_no_prefill_qty.py +1 -1
- odoo/addons/shopfloor/tests/test_cluster_picking_stock_issue.py +5 -5
- odoo/addons/shopfloor/tests/test_delivery_base.py +4 -6
- odoo/addons/shopfloor/tests/test_delivery_done.py +1 -1
- odoo/addons/shopfloor/tests/test_delivery_reset_qty_done_line.py +1 -1
- odoo/addons/shopfloor/tests/test_delivery_reset_qty_done_pack.py +1 -1
- odoo/addons/shopfloor/tests/test_delivery_scan_deliver.py +6 -6
- odoo/addons/shopfloor/tests/test_location_content_transfer_base.py +2 -2
- odoo/addons/shopfloor/tests/test_location_content_transfer_mix.py +8 -8
- odoo/addons/shopfloor/tests/test_location_content_transfer_set_destination_package_or_line.py +41 -41
- odoo/addons/shopfloor/tests/test_location_content_transfer_single.py +3 -3
- odoo/addons/shopfloor/tests/test_menu_base.py +4 -4
- odoo/addons/shopfloor/tests/test_move_action_assign.py +19 -4
- odoo/addons/shopfloor/tests/test_single_pack_transfer.py +3 -3
- odoo/addons/shopfloor/tests/test_stock_split.py +77 -17
- odoo/addons/shopfloor/tests/test_zone_picking_base.py +5 -5
- odoo/addons/shopfloor/tests/test_zone_picking_change_pack_lot.py +2 -2
- odoo/addons/shopfloor/tests/test_zone_picking_complete_mix_pack_flux.py +2 -2
- odoo/addons/shopfloor/tests/test_zone_picking_require_destination_package.py +3 -3
- odoo/addons/shopfloor/tests/test_zone_picking_select_line.py +4 -4
- odoo/addons/shopfloor/tests/test_zone_picking_set_line_destination.py +29 -29
- odoo/addons/shopfloor/tests/test_zone_picking_set_line_destination_package_not_allowed.py +2 -2
- odoo/addons/shopfloor/tests/test_zone_picking_set_line_destination_pick_pack.py +12 -12
- odoo/addons/shopfloor/tests/test_zone_picking_start.py +1 -1
- odoo/addons/shopfloor/tests/test_zone_picking_unload_all.py +12 -12
- odoo/addons/shopfloor/tests/test_zone_picking_unload_buffer_lines.py +4 -4
- odoo/addons/shopfloor/tests/test_zone_picking_unload_set_destination.py +10 -10
- odoo/addons/shopfloor/tests/test_zone_picking_unload_single.py +3 -3
- odoo/addons/shopfloor/views/shopfloor_menu.xml +33 -102
- odoo/addons/shopfloor/views/stock_move_line.xml +2 -2
- odoo/addons/shopfloor/views/stock_picking_type.xml +1 -1
- odoo_addon_shopfloor-18.0.0.1.0.15.dist-info/METADATA +222 -0
- {odoo_addon_shopfloor-16.0.2.12.0.1.dist-info → odoo_addon_shopfloor-18.0.0.1.0.15.dist-info}/RECORD +94 -98
- {odoo_addon_shopfloor-16.0.2.12.0.1.dist-info → odoo_addon_shopfloor-18.0.0.1.0.15.dist-info}/WHEEL +1 -1
- odoo_addon_shopfloor-18.0.0.1.0.15.dist-info/top_level.txt +1 -0
- odoo/addons/shopfloor/actions/barcode_parser.py +0 -44
- odoo/addons/shopfloor/migrations/16.0.2.0.0/post-migration.py +0 -41
- odoo/addons/shopfloor/migrations/16.0.2.4.2/post-init_search_move_line_options.py +0 -33
- odoo/addons/shopfloor/migrations/16.0.2.4.2/post-migration.py +0 -29
- odoo/addons/shopfloor/readme/CONTRIBUTORS.rst +0 -18
- odoo/addons/shopfloor/readme/CREDITS.rst +0 -5
- odoo/addons/shopfloor/readme/DESCRIPTION.rst +0 -17
- odoo/addons/shopfloor/readme/ROADMAP.rst +0 -4
- odoo/addons/shopfloor/readme/USAGE.rst +0 -6
- odoo_addon_shopfloor-16.0.2.12.0.1.dist-info/METADATA +0 -193
- odoo_addon_shopfloor-16.0.2.12.0.1.dist-info/top_level.txt +0 -1
@@ -31,7 +31,13 @@ class ActionsDataCaseBase(CommonCase, ActionsDataTestMixin):
|
|
31
31
|
cls.packaging = (
|
32
32
|
cls.env["product.packaging"]
|
33
33
|
.sudo()
|
34
|
-
.create(
|
34
|
+
.create(
|
35
|
+
{
|
36
|
+
"name": "Pallet",
|
37
|
+
"packaging_level_id": cls.packaging_type.id,
|
38
|
+
"product_id": cls.product_b.id,
|
39
|
+
}
|
40
|
+
)
|
35
41
|
)
|
36
42
|
cls.delivery_packaging = (
|
37
43
|
cls.env["stock.package.type"]
|
@@ -87,7 +93,7 @@ class ActionsDataCaseBase(CommonCase, ActionsDataTestMixin):
|
|
87
93
|
cls.product_a_variant = cls.product_a.copy(
|
88
94
|
{
|
89
95
|
"name": "Product A variant 1",
|
90
|
-
"
|
96
|
+
"is_storable": True,
|
91
97
|
"default_code": "A-VARIANT",
|
92
98
|
"barcode": "A-VARIANT",
|
93
99
|
}
|
@@ -176,7 +182,7 @@ class ActionsDataCaseBase(CommonCase, ActionsDataTestMixin):
|
|
176
182
|
data = {
|
177
183
|
"id": record.id,
|
178
184
|
"name": record.name,
|
179
|
-
"weight": record.
|
185
|
+
"weight": record.shopfloor_weight,
|
180
186
|
"storage_type": None,
|
181
187
|
"total_quantity": sum(record.quant_ids.mapped("quantity")),
|
182
188
|
}
|
@@ -24,7 +24,7 @@ class TestActionsDataDetailCase(ActionsDataDetailCaseBase):
|
|
24
24
|
move_lines = self.env["stock.move.line"].search(
|
25
25
|
[
|
26
26
|
("location_id", "child_of", location.id),
|
27
|
-
("
|
27
|
+
("quantity_product_uom", ">", 0),
|
28
28
|
("state", "not in", ("done", "cancel")),
|
29
29
|
]
|
30
30
|
)
|
@@ -148,6 +148,7 @@ class TestActionsDataDetailCase(ActionsDataDetailCaseBase):
|
|
148
148
|
"carrier_id": carrier.id,
|
149
149
|
}
|
150
150
|
)
|
151
|
+
picking.move_ids[0].quantity = 5.0
|
151
152
|
picking.move_ids.write({"date": "2020-05-13"})
|
152
153
|
data = self.data_detail.picking_detail(picking, with_progress=True)
|
153
154
|
self.assert_schema(self.schema_detail.picking_detail(), data)
|
@@ -160,7 +161,7 @@ class TestActionsDataDetailCase(ActionsDataDetailCaseBase):
|
|
160
161
|
"note": Markup("<p>read me</p>"),
|
161
162
|
"origin": "created by test",
|
162
163
|
"ship_carrier": None,
|
163
|
-
"weight":
|
164
|
+
"weight": 100.0,
|
164
165
|
"partner": {"id": self.customer.id, "name": self.customer.name},
|
165
166
|
"carrier": {"id": picking.carrier_id.id, "name": picking.carrier_id.name},
|
166
167
|
"priority": "Urgent",
|
@@ -170,7 +171,7 @@ class TestActionsDataDetailCase(ActionsDataDetailCaseBase):
|
|
170
171
|
},
|
171
172
|
"move_lines": self.data_detail.move_lines(picking.move_line_ids),
|
172
173
|
"picking_type_code": "outgoing",
|
173
|
-
"progress":
|
174
|
+
"progress": 87.5,
|
174
175
|
}
|
175
176
|
self.assertEqual(data.pop("scheduled_date").split("T")[0], "2020-05-13")
|
176
177
|
self.assertDictEqual(data, expected)
|
@@ -180,20 +181,21 @@ class TestActionsDataDetailCase(ActionsDataDetailCaseBase):
|
|
180
181
|
result_package = self.env["stock.quant.package"].create(
|
181
182
|
{"product_packaging_id": self.packaging.id}
|
182
183
|
)
|
183
|
-
move_line.
|
184
|
+
move_line.result_package_id = result_package
|
185
|
+
move_line._pick_qty(3.0)
|
184
186
|
data = self.data_detail.move_line(move_line)
|
185
187
|
self.assert_schema(self.schema_detail.move_line(), data)
|
186
188
|
product = self.product_a.with_context(location=move_line.location_id.id)
|
187
189
|
expected = {
|
188
190
|
"id": move_line.id,
|
189
191
|
"qty_done": 3.0,
|
190
|
-
"quantity": move_line.
|
192
|
+
"quantity": move_line.quantity,
|
191
193
|
"product": self._expected_product_detail(product),
|
192
194
|
"lot": None,
|
193
195
|
"package_src": {
|
194
196
|
"id": move_line.package_id.id,
|
195
197
|
"name": move_line.package_id.name,
|
196
|
-
"weight":
|
198
|
+
"weight": move_line.package_id.shopfloor_weight,
|
197
199
|
"storage_type": None,
|
198
200
|
"total_quantity": sum(
|
199
201
|
move_line.package_id.quant_ids.mapped("quantity")
|
@@ -202,7 +204,7 @@ class TestActionsDataDetailCase(ActionsDataDetailCaseBase):
|
|
202
204
|
"package_dest": {
|
203
205
|
"id": result_package.id,
|
204
206
|
"name": result_package.name,
|
205
|
-
"weight":
|
207
|
+
"weight": result_package.shopfloor_weight,
|
206
208
|
"storage_type": None,
|
207
209
|
"total_quantity": sum(
|
208
210
|
move_line.result_package_id.quant_ids.mapped("quantity")
|
@@ -211,7 +213,6 @@ class TestActionsDataDetailCase(ActionsDataDetailCaseBase):
|
|
211
213
|
"location_src": self._expected_location(move_line.location_id),
|
212
214
|
"location_dest": self._expected_location(move_line.location_dest_id),
|
213
215
|
"priority": "1",
|
214
|
-
"progress": 30.0,
|
215
216
|
}
|
216
217
|
self.assertDictEqual(data, expected)
|
217
218
|
data = self.data_detail.move_line(move_line, with_package_move_line_count=True)
|
@@ -226,8 +227,8 @@ class TestActionsDataDetailCase(ActionsDataDetailCaseBase):
|
|
226
227
|
product = self.product_b.with_context(location=move_line.location_id.id)
|
227
228
|
expected = {
|
228
229
|
"id": move_line.id,
|
229
|
-
"qty_done": 0
|
230
|
-
"quantity": move_line.
|
230
|
+
"qty_done": 0,
|
231
|
+
"quantity": move_line.quantity,
|
231
232
|
"product": self._expected_product_detail(product),
|
232
233
|
"lot": {
|
233
234
|
"id": move_line.lot_id.id,
|
@@ -240,7 +241,6 @@ class TestActionsDataDetailCase(ActionsDataDetailCaseBase):
|
|
240
241
|
"location_src": self._expected_location(move_line.location_id),
|
241
242
|
"location_dest": self._expected_location(move_line.location_dest_id),
|
242
243
|
"priority": "1",
|
243
|
-
"progress": 0.0,
|
244
244
|
}
|
245
245
|
self.assertDictEqual(data, expected)
|
246
246
|
|
@@ -251,8 +251,8 @@ class TestActionsDataDetailCase(ActionsDataDetailCaseBase):
|
|
251
251
|
product = self.product_c.with_context(location=move_line.location_id.id)
|
252
252
|
expected = {
|
253
253
|
"id": move_line.id,
|
254
|
-
"qty_done": 0
|
255
|
-
"quantity": move_line.
|
254
|
+
"qty_done": 0,
|
255
|
+
"quantity": move_line.quantity,
|
256
256
|
"product": self._expected_product_detail(product),
|
257
257
|
"lot": {
|
258
258
|
"id": move_line.lot_id.id,
|
@@ -263,7 +263,7 @@ class TestActionsDataDetailCase(ActionsDataDetailCaseBase):
|
|
263
263
|
"package_src": {
|
264
264
|
"id": move_line.package_id.id,
|
265
265
|
"name": move_line.package_id.name,
|
266
|
-
"weight":
|
266
|
+
"weight": move_line.package_id.shopfloor_weight,
|
267
267
|
"storage_type": None,
|
268
268
|
"total_quantity": sum(
|
269
269
|
move_line.package_id.quant_ids.mapped("quantity")
|
@@ -272,7 +272,7 @@ class TestActionsDataDetailCase(ActionsDataDetailCaseBase):
|
|
272
272
|
"package_dest": {
|
273
273
|
"id": move_line.result_package_id.id,
|
274
274
|
"name": move_line.result_package_id.name,
|
275
|
-
"weight":
|
275
|
+
"weight": move_line.result_package_id.shopfloor_weight,
|
276
276
|
"storage_type": None,
|
277
277
|
"total_quantity": sum(
|
278
278
|
move_line.result_package_id.quant_ids.mapped("quantity")
|
@@ -281,7 +281,6 @@ class TestActionsDataDetailCase(ActionsDataDetailCaseBase):
|
|
281
281
|
"location_src": self._expected_location(move_line.location_id),
|
282
282
|
"location_dest": self._expected_location(move_line.location_dest_id),
|
283
283
|
"priority": "1",
|
284
|
-
"progress": 0.0,
|
285
284
|
}
|
286
285
|
self.assertDictEqual(data, expected)
|
287
286
|
data = self.data_detail.move_line(move_line, with_package_move_line_count=True)
|
@@ -296,8 +295,8 @@ class TestActionsDataDetailCase(ActionsDataDetailCaseBase):
|
|
296
295
|
product = self.product_d.with_context(location=move_line.location_id.id)
|
297
296
|
expected = {
|
298
297
|
"id": move_line.id,
|
299
|
-
"qty_done": 0
|
300
|
-
"quantity": move_line.
|
298
|
+
"qty_done": 0,
|
299
|
+
"quantity": move_line.quantity,
|
301
300
|
"product": self._expected_product_detail(product),
|
302
301
|
"lot": None,
|
303
302
|
"package_src": None,
|
@@ -305,7 +304,6 @@ class TestActionsDataDetailCase(ActionsDataDetailCaseBase):
|
|
305
304
|
"location_src": self._expected_location(move_line.location_id),
|
306
305
|
"location_dest": self._expected_location(move_line.location_dest_id),
|
307
306
|
"priority": "1",
|
308
|
-
"progress": 0.0,
|
309
307
|
}
|
310
308
|
self.assertDictEqual(data, expected)
|
311
309
|
|
@@ -94,7 +94,8 @@ class TestSearchCase(TestSearchBaseCase):
|
|
94
94
|
self.assertEqual(handler(lots[0].name, products=self.product_b), lots[1])
|
95
95
|
self.assertEqual(handler(lots[1].name, products=self.product_b), lots[1])
|
96
96
|
|
97
|
-
def
|
97
|
+
def __TODO__test_search_generic_packaging(self):
|
98
|
+
# FIXME: generic packaging is not defined anymore w/ a packaging w/o product
|
98
99
|
rec = (
|
99
100
|
self.env["product.packaging"]
|
100
101
|
.sudo()
|
@@ -59,9 +59,9 @@ class CheckoutAutoPostCase(CheckoutCommonCase):
|
|
59
59
|
line_b_in_original_picking = picking.move_line_ids.filtered(
|
60
60
|
lambda x: x.product_id == selected_move_line_b.product_id
|
61
61
|
)
|
62
|
-
self.assertEqual(line_a_in_original_picking.
|
63
|
-
self.assertEqual(line_b_in_original_picking.
|
64
|
-
self.assertEqual(selected_move_line_c.
|
62
|
+
self.assertEqual(line_a_in_original_picking.quantity, 3)
|
63
|
+
self.assertEqual(line_b_in_original_picking.quantity, 11)
|
64
|
+
self.assertEqual(selected_move_line_c.quantity, 30)
|
65
65
|
|
66
66
|
self.assertEqual(line_a_in_original_picking.qty_done, 0)
|
67
67
|
self.assertEqual(line_b_in_original_picking.qty_done, 0)
|
@@ -91,6 +91,6 @@ class CheckoutCommonCase(CommonCase):
|
|
91
91
|
"message_type": "warning",
|
92
92
|
"body": "The quantity scanned for one or more lines cannot be "
|
93
93
|
"higher than the maximum allowed. "
|
94
|
-
f"({line.product_id.name} : {str(line.qty_done)} > {str(line.
|
94
|
+
f"({line.product_id.name} : {str(line.qty_done)} > {str(line.quantity)})", # noqa
|
95
95
|
},
|
96
96
|
)
|
@@ -106,7 +106,7 @@ class CheckoutListDeliveryPackagingCase(CheckoutCommonCase, CheckoutSelectPackag
|
|
106
106
|
self.picking.action_assign()
|
107
107
|
selected_lines = self.picking.move_line_ids
|
108
108
|
# for line in selected_lines:
|
109
|
-
# line.qty_done = line.
|
109
|
+
# line.qty_done = line.quantity
|
110
110
|
response = self.service.dispatch(
|
111
111
|
"list_delivery_packaging",
|
112
112
|
params={
|
@@ -137,8 +137,8 @@ class CheckoutScanSetDestPackageCase(CheckoutCommonCase, SelectDestPackageMixin)
|
|
137
137
|
# them
|
138
138
|
cls.move_line1.result_package_id = cls.delivery_package
|
139
139
|
# We'll put only product A and B in the destination package
|
140
|
-
cls.move_line1.qty_done = cls.move_line1.
|
141
|
-
cls.move_line2.qty_done = cls.move_line2.
|
140
|
+
cls.move_line1.qty_done = cls.move_line1.quantity
|
141
|
+
cls.move_line2.qty_done = cls.move_line2.quantity
|
142
142
|
cls.move_line3.qty_done = 0
|
143
143
|
|
144
144
|
cls.picking = picking
|
@@ -266,7 +266,7 @@ class CheckoutScanSetDestPackageCase(CheckoutCommonCase, SelectDestPackageMixin)
|
|
266
266
|
)
|
267
267
|
# Left quantity to do from line 3
|
268
268
|
new_move_line = self.picking.move_line_ids.filtered(
|
269
|
-
lambda line: line.qty_done == 0 and line.
|
269
|
+
lambda line: line.qty_done == 0 and line.quantity == 7
|
270
270
|
)
|
271
271
|
self.assertTrue(new_move_line)
|
272
272
|
self.assertFalse(new_move_line.shopfloor_checkout_done)
|
@@ -318,7 +318,7 @@ class CheckoutScanSetDestPackageCase(CheckoutCommonCase, SelectDestPackageMixin)
|
|
318
318
|
# the maximum allowed, a message should be displayed
|
319
319
|
# and the user shouldn't be allowed to select a package.
|
320
320
|
line = fields.first(self.picking.move_line_ids)
|
321
|
-
line.qty_done = line.
|
321
|
+
line.qty_done = line.quantity + 1
|
322
322
|
response = self.service.dispatch(
|
323
323
|
"list_dest_package",
|
324
324
|
params={
|
@@ -28,8 +28,8 @@ class CheckoutNewPackageCase(CheckoutCommonCase, CheckoutSelectPackageMixin):
|
|
28
28
|
|
29
29
|
move_line1, move_line2, move_line3 = selected_lines
|
30
30
|
# we'll put only the first 2 lines (product A and B) in the new package
|
31
|
-
move_line1.qty_done = move_line1.
|
32
|
-
move_line2.qty_done = move_line2.
|
31
|
+
move_line1.qty_done = move_line1.quantity
|
32
|
+
move_line2.qty_done = move_line2.quantity
|
33
33
|
move_line3.qty_done = 0
|
34
34
|
|
35
35
|
response = self.service.dispatch(
|
@@ -77,7 +77,7 @@ class CheckoutNewPackageCase(CheckoutCommonCase, CheckoutSelectPackageMixin):
|
|
77
77
|
# and the user shouldn't be allowed to select a package.
|
78
78
|
selected_lines = moves.move_line_ids
|
79
79
|
line = fields.first(selected_lines)
|
80
|
-
line.qty_done = line.
|
80
|
+
line.qty_done = line.quantity + 1
|
81
81
|
response = self.service.dispatch(
|
82
82
|
"list_dest_package",
|
83
83
|
params={
|
@@ -33,8 +33,8 @@ class CheckoutNoPackageCase(CheckoutCommonCase, CheckoutSelectPackageMixin):
|
|
33
33
|
selected_lines = move_line1 + move_line2
|
34
34
|
|
35
35
|
# we'll put only the first 2 lines (product A and B) w/ no package
|
36
|
-
move_line1.qty_done = move_line1.
|
37
|
-
move_line2.qty_done = move_line2.
|
36
|
+
move_line1.qty_done = move_line1.quantity
|
37
|
+
move_line2.qty_done = move_line2.quantity
|
38
38
|
move_line3.qty_done = 0
|
39
39
|
response = self.service.dispatch(
|
40
40
|
"no_package",
|
@@ -84,7 +84,7 @@ class CheckoutNoPackageCase(CheckoutCommonCase, CheckoutSelectPackageMixin):
|
|
84
84
|
# the maximum allowed, a message should be displayed
|
85
85
|
# and the user shouldn't be allowed to select a package.
|
86
86
|
line = fields.first(self.picking.move_line_ids)
|
87
|
-
line.qty_done = line.
|
87
|
+
line.qty_done = line.quantity + 1
|
88
88
|
response = self.service.dispatch(
|
89
89
|
"list_dest_package",
|
90
90
|
params={
|
@@ -49,7 +49,7 @@ class CheckoutSelectChildLocationCase(CheckoutCommonCase):
|
|
49
49
|
|
50
50
|
self.assertRecordValues(self.picking, [{"state": "done"}])
|
51
51
|
self.assertTrue(self.picking.backorder_ids)
|
52
|
-
self.assertEqual(self.picking.backorder_ids.move_line_ids.
|
52
|
+
self.assertEqual(self.picking.backorder_ids.move_line_ids.quantity, 8)
|
53
53
|
|
54
54
|
self.assert_response(
|
55
55
|
response,
|
@@ -40,18 +40,18 @@ class CheckoutScanPackageActionCase(CheckoutCommonCase, CheckoutSelectPackageMix
|
|
40
40
|
|
41
41
|
def test_scan_package_action_select_product(self):
|
42
42
|
self._test_select_product(
|
43
|
-
lambda x: x.product_id.barcode, lambda x: x.
|
43
|
+
lambda x: x.product_id.barcode, lambda x: x.quantity, lambda __: 0
|
44
44
|
)
|
45
45
|
|
46
46
|
def test_scan_package_action_deselect_product(self):
|
47
47
|
self._test_select_product(
|
48
|
-
lambda x: x.product_id.barcode, lambda __: 0, lambda x: x.
|
48
|
+
lambda x: x.product_id.barcode, lambda __: 0, lambda x: x.quantity
|
49
49
|
)
|
50
50
|
|
51
51
|
def test_scan_package_action_select_product_packaging(self):
|
52
52
|
self._test_select_product(
|
53
53
|
lambda x: x.product_id.packaging_ids.barcode,
|
54
|
-
lambda x: x.
|
54
|
+
lambda x: x.quantity,
|
55
55
|
lambda __: 0,
|
56
56
|
)
|
57
57
|
|
@@ -59,21 +59,21 @@ class CheckoutScanPackageActionCase(CheckoutCommonCase, CheckoutSelectPackageMix
|
|
59
59
|
self._test_select_product(
|
60
60
|
lambda x: x.product_id.packaging_ids.barcode,
|
61
61
|
lambda __: 0,
|
62
|
-
lambda x: x.
|
62
|
+
lambda x: x.quantity,
|
63
63
|
)
|
64
64
|
|
65
65
|
def test_scan_package_action_select_product_lot(self):
|
66
66
|
self._test_select_product(
|
67
67
|
lambda x: x.lot_id.name,
|
68
68
|
lambda __: 0,
|
69
|
-
lambda x: x.
|
69
|
+
lambda x: x.quantity,
|
70
70
|
in_lot=True,
|
71
71
|
)
|
72
72
|
|
73
73
|
def test_scan_package_action_deselect_product_lot(self):
|
74
74
|
self._test_select_product(
|
75
75
|
lambda x: x.lot_id.name,
|
76
|
-
lambda x: x.
|
76
|
+
lambda x: x.quantity,
|
77
77
|
lambda __: 0,
|
78
78
|
in_lot=True,
|
79
79
|
)
|
@@ -135,8 +135,8 @@ class CheckoutScanPackageActionCase(CheckoutCommonCase, CheckoutSelectPackageMix
|
|
135
135
|
|
136
136
|
move_line1, move_line2, move_line3 = selected_lines
|
137
137
|
# We'll put only product A and B in the package
|
138
|
-
move_line1.qty_done = move_line1.
|
139
|
-
move_line2.qty_done = move_line2.
|
138
|
+
move_line1.qty_done = move_line1.quantity
|
139
|
+
move_line2.qty_done = move_line2.quantity
|
140
140
|
move_line3.qty_done = 0
|
141
141
|
|
142
142
|
response = self.service.dispatch(
|
@@ -296,8 +296,8 @@ class CheckoutScanPackageActionCase(CheckoutCommonCase, CheckoutSelectPackageMix
|
|
296
296
|
|
297
297
|
move_line1, move_line2, move_line3 = selected_lines
|
298
298
|
# we'll put only the first 2 lines (product A and B) in the new package
|
299
|
-
move_line1.qty_done = move_line1.
|
300
|
-
move_line2.qty_done = move_line2.
|
299
|
+
move_line1.qty_done = move_line1.quantity
|
300
|
+
move_line2.qty_done = move_line2.quantity
|
301
301
|
move_line3.qty_done = 0
|
302
302
|
|
303
303
|
packaging = (
|
@@ -368,7 +368,7 @@ class CheckoutScanPackageActionCase(CheckoutCommonCase, CheckoutSelectPackageMix
|
|
368
368
|
self._fill_stock_for_moves(pack1_moves, in_package=True)
|
369
369
|
picking.action_assign()
|
370
370
|
selected_lines = pack1_moves.move_line_ids
|
371
|
-
selected_lines.qty_done = selected_lines.
|
371
|
+
selected_lines.qty_done = selected_lines.quantity
|
372
372
|
|
373
373
|
packaging = (
|
374
374
|
self.env["stock.package.type"]
|
@@ -58,7 +58,7 @@ class CheckoutSelectPackageMixin:
|
|
58
58
|
for line in selected_lines - related_lines:
|
59
59
|
self.assertEqual(
|
60
60
|
line.qty_done,
|
61
|
-
line.
|
61
|
+
line.quantity,
|
62
62
|
"Scanned lines must have their qty done set to the reserved quantity",
|
63
63
|
)
|
64
64
|
for line in unselected_lines + related_lines:
|
@@ -25,12 +25,12 @@ class CheckoutSetQtyCommonCase(CheckoutCommonCase, CheckoutSelectPackageMixin):
|
|
25
25
|
super().setUp()
|
26
26
|
# we assume we have called /select_line on pack one, so by default, we
|
27
27
|
# expect the lines for product a and b to have their qty_done set to
|
28
|
-
# their
|
28
|
+
# their reserved quantity at the start of the tests
|
29
29
|
self.selected_lines = self.moves_pack1.move_line_ids
|
30
30
|
self.deselected_lines = self.moves_pack2.move_line_ids
|
31
31
|
self.service._select_lines(self.selected_lines)
|
32
32
|
self.assertTrue(
|
33
|
-
all(line.qty_done == line.
|
33
|
+
all(line.qty_done == line.quantity for line in self.selected_lines)
|
34
34
|
)
|
35
35
|
self.assertTrue(all(line.qty_done == 0 for line in self.deselected_lines))
|
36
36
|
|
@@ -53,7 +53,7 @@ class CheckoutResetLineQtyCase(CheckoutSetQtyCommonCase):
|
|
53
53
|
self._assert_selected_qties(
|
54
54
|
response,
|
55
55
|
selected_lines,
|
56
|
-
{line_to_reset: 0, line_with_qty: line_with_qty.
|
56
|
+
{line_to_reset: 0, line_with_qty: line_with_qty.quantity},
|
57
57
|
)
|
58
58
|
|
59
59
|
def test_reset_line_qty_not_found(self):
|
@@ -71,7 +71,7 @@ class CheckoutResetLineQtyCase(CheckoutSetQtyCommonCase):
|
|
71
71
|
self._assert_selected_qties(
|
72
72
|
response,
|
73
73
|
selected_lines,
|
74
|
-
{line: line.
|
74
|
+
{line: line.quantity for line in selected_lines},
|
75
75
|
message={
|
76
76
|
"body": "The record you were working on does not exist anymore.",
|
77
77
|
"message_type": "error",
|
@@ -96,12 +96,12 @@ class CheckoutSetLineQtyCase(CheckoutSetQtyCommonCase):
|
|
96
96
|
"move_line_id": line_to_set.id,
|
97
97
|
},
|
98
98
|
)
|
99
|
-
self.assertEqual(line_to_set.qty_done, line_to_set.
|
99
|
+
self.assertEqual(line_to_set.qty_done, line_to_set.quantity)
|
100
100
|
self.assertEqual(line_no_qty.qty_done, 0)
|
101
101
|
self._assert_selected_qties(
|
102
102
|
response,
|
103
103
|
selected_lines,
|
104
|
-
{line_to_set: line_to_set.
|
104
|
+
{line_to_set: line_to_set.quantity, line_no_qty: 0},
|
105
105
|
)
|
106
106
|
|
107
107
|
def test_set_line_qty_not_found(self):
|
@@ -119,7 +119,7 @@ class CheckoutSetLineQtyCase(CheckoutSetQtyCommonCase):
|
|
119
119
|
self._assert_selected_qties(
|
120
120
|
response,
|
121
121
|
selected_lines,
|
122
|
-
{line: line.
|
122
|
+
{line: line.quantity for line in selected_lines},
|
123
123
|
message={
|
124
124
|
"body": "The record you were working on does not exist anymore.",
|
125
125
|
"message_type": "error",
|
@@ -133,7 +133,7 @@ class CheckoutSetCustomQtyCase(CheckoutSetQtyCommonCase):
|
|
133
133
|
line_to_change = selected_lines[0]
|
134
134
|
line_keep_qty = selected_lines[1]
|
135
135
|
# Process full qty
|
136
|
-
new_qty = line_to_change.
|
136
|
+
new_qty = line_to_change.quantity
|
137
137
|
# we want to check that when we give the package id, we get
|
138
138
|
# all its move lines
|
139
139
|
response = self.service.dispatch(
|
@@ -146,11 +146,11 @@ class CheckoutSetCustomQtyCase(CheckoutSetQtyCommonCase):
|
|
146
146
|
},
|
147
147
|
)
|
148
148
|
self.assertEqual(line_to_change.qty_done, new_qty)
|
149
|
-
self.assertEqual(line_keep_qty.qty_done, line_keep_qty.
|
149
|
+
self.assertEqual(line_keep_qty.qty_done, line_keep_qty.quantity)
|
150
150
|
self._assert_selected_qties(
|
151
151
|
response,
|
152
152
|
selected_lines,
|
153
|
-
{line_to_change: new_qty, line_keep_qty: line_keep_qty.
|
153
|
+
{line_to_change: new_qty, line_keep_qty: line_keep_qty.quantity},
|
154
154
|
)
|
155
155
|
|
156
156
|
def test_set_custom_qty_not_found(self):
|
@@ -169,7 +169,7 @@ class CheckoutSetCustomQtyCase(CheckoutSetQtyCommonCase):
|
|
169
169
|
self._assert_selected_qties(
|
170
170
|
response,
|
171
171
|
selected_lines,
|
172
|
-
{line: line.
|
172
|
+
{line: line.quantity for line in selected_lines},
|
173
173
|
message={
|
174
174
|
"body": "The record you were working on does not exist anymore.",
|
175
175
|
"message_type": "error",
|
@@ -188,13 +188,13 @@ class CheckoutSetCustomQtyCase(CheckoutSetQtyCommonCase):
|
|
188
188
|
"picking_id": self.picking.id,
|
189
189
|
"selected_line_ids": selected_lines.ids,
|
190
190
|
"move_line_id": line1.id,
|
191
|
-
"qty_done": line1.
|
191
|
+
"qty_done": line1.quantity + 1,
|
192
192
|
},
|
193
193
|
)
|
194
194
|
self._assert_selected_qties(
|
195
195
|
response,
|
196
196
|
selected_lines,
|
197
|
-
{line1: line1.
|
197
|
+
{line1: line1.quantity + 1, line2: line2.quantity},
|
198
198
|
message={
|
199
199
|
"body": "Please note that the scanned quantity "
|
200
200
|
"is higher than the maximum allowed.",
|
@@ -218,7 +218,7 @@ class CheckoutSetCustomQtyCase(CheckoutSetQtyCommonCase):
|
|
218
218
|
self._assert_selected_qties(
|
219
219
|
response,
|
220
220
|
selected_lines,
|
221
|
-
{line1: line1.
|
221
|
+
{line1: line1.quantity, line2: line2.quantity},
|
222
222
|
message={
|
223
223
|
"body": "Negative quantity not allowed.",
|
224
224
|
"message_type": "error",
|
@@ -230,7 +230,7 @@ class CheckoutSetCustomQtyCase(CheckoutSetQtyCommonCase):
|
|
230
230
|
line_to_change = selected_lines[0]
|
231
231
|
line_keep_qty = selected_lines[1]
|
232
232
|
# split 1 qty
|
233
|
-
new_qty = line_to_change.
|
233
|
+
new_qty = line_to_change.quantity - 1
|
234
234
|
response = self.service.dispatch(
|
235
235
|
"set_custom_qty",
|
236
236
|
params={
|
@@ -241,7 +241,7 @@ class CheckoutSetCustomQtyCase(CheckoutSetQtyCommonCase):
|
|
241
241
|
},
|
242
242
|
)
|
243
243
|
self.assertEqual(line_to_change.qty_done, new_qty)
|
244
|
-
self.assertEqual(line_keep_qty.qty_done, line_keep_qty.
|
244
|
+
self.assertEqual(line_keep_qty.qty_done, line_keep_qty.quantity)
|
245
245
|
new_lines = [
|
246
246
|
x for x in self.moves_pack1.move_line_ids if x not in selected_lines
|
247
247
|
]
|
@@ -252,6 +252,6 @@ class CheckoutSetCustomQtyCase(CheckoutSetQtyCommonCase):
|
|
252
252
|
self.moves_pack1.move_line_ids,
|
253
253
|
{
|
254
254
|
line_to_change: new_qty,
|
255
|
-
line_keep_qty: line_keep_qty.
|
255
|
+
line_keep_qty: line_keep_qty.quantity,
|
256
256
|
},
|
257
257
|
)
|
@@ -35,7 +35,7 @@ class CheckoutSummaryCase(CheckoutCommonCase):
|
|
35
35
|
self.picking.action_assign()
|
36
36
|
# satisfy only few lines
|
37
37
|
for ml in self.picking.move_line_ids[:2]:
|
38
|
-
ml.qty_done = ml.
|
38
|
+
ml.qty_done = ml.quantity
|
39
39
|
ml.shopfloor_checkout_done = True
|
40
40
|
response = self.service.dispatch(
|
41
41
|
"summary", params={"picking_id": self.picking.id}
|
@@ -54,7 +54,7 @@ class CheckoutSummaryCase(CheckoutCommonCase):
|
|
54
54
|
self.picking.action_assign()
|
55
55
|
# satisfy only all lines
|
56
56
|
for ml in self.picking.move_line_ids:
|
57
|
-
ml.qty_done = ml.
|
57
|
+
ml.qty_done = ml.quantity
|
58
58
|
ml.shopfloor_checkout_done = True
|
59
59
|
response = self.service.dispatch(
|
60
60
|
"summary", params={"picking_id": self.picking.id}
|
@@ -21,12 +21,12 @@ class ClusterPickingBatchCase(CommonCase, PickingBatchMixin):
|
|
21
21
|
cls.product_a = (
|
22
22
|
cls.env["product.product"]
|
23
23
|
.sudo()
|
24
|
-
.create({"name": "Product A", "
|
24
|
+
.create({"name": "Product A", "is_storable": True})
|
25
25
|
)
|
26
26
|
cls.product_b = (
|
27
27
|
cls.env["product.product"]
|
28
28
|
.sudo()
|
29
|
-
.create({"name": "Product B", "
|
29
|
+
.create({"name": "Product B", "is_storable": True})
|
30
30
|
)
|
31
31
|
cls.batch1 = cls._create_picking_batch(
|
32
32
|
[[cls.BatchProduct(product=cls.product_a, quantity=1)]]
|
@@ -35,7 +35,7 @@ class ClusterPickingIsZeroCase(ClusterPickingCommonCase):
|
|
35
35
|
cls.next_line = cls.picking.move_line_ids[1]
|
36
36
|
cls.bin1 = cls.env["stock.quant.package"].create({})
|
37
37
|
cls._update_qty_in_location(
|
38
|
-
cls.line.location_id, cls.line.product_id, cls.line.
|
38
|
+
cls.line.location_id, cls.line.product_id, cls.line.quantity
|
39
39
|
)
|
40
40
|
# we already scan and put the first line in bin1, at this point the
|
41
41
|
# system see the location is empty and reach "zero_check"
|