odoo-addon-shopfloor 16.0.2.12.0.1__py3-none-any.whl → 18.0.0.1.1__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 +8 -7
- 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 +4 -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.1.dist-info/METADATA +222 -0
- {odoo_addon_shopfloor-16.0.2.12.0.1.dist-info → odoo_addon_shopfloor-18.0.0.1.1.dist-info}/RECORD +94 -98
- {odoo_addon_shopfloor-16.0.2.12.0.1.dist-info → odoo_addon_shopfloor-18.0.0.1.1.dist-info}/WHEEL +1 -1
- odoo_addon_shopfloor-18.0.0.1.1.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
@@ -1,6 +1,6 @@
|
|
1
1
|
# Copyright 2020 Camptocamp SA (http://www.camptocamp.com)
|
2
2
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
3
|
-
from odoo.tests
|
3
|
+
from odoo.tests import Form
|
4
4
|
|
5
5
|
from .common import CommonCase
|
6
6
|
|
@@ -31,7 +31,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
31
31
|
picking_form.picking_type_id = self.picking_type
|
32
32
|
picking_form.location_id = self.stock_location
|
33
33
|
for package in packages:
|
34
|
-
with picking_form.
|
34
|
+
with picking_form.package_level_ids.new() as move:
|
35
35
|
move.package_id = package
|
36
36
|
picking = picking_form.save()
|
37
37
|
picking.action_confirm()
|
@@ -83,7 +83,9 @@ class TestActionsChangePackageLot(CommonCase):
|
|
83
83
|
self.assertRecordValues(line, [{"lot_id": new_lot.id}])
|
84
84
|
# check that reservations have been updated
|
85
85
|
self.assert_quant_reserved_qty(line, lambda: 0, lot=initial_lot)
|
86
|
-
self.assert_quant_reserved_qty(
|
86
|
+
self.assert_quant_reserved_qty(
|
87
|
+
line, lambda: line.quantity_product_uom, lot=new_lot
|
88
|
+
)
|
87
89
|
|
88
90
|
def test_change_lot_less_quantity_ok(self):
|
89
91
|
initial_lot = self._create_lot(self.product_a)
|
@@ -105,14 +107,18 @@ class TestActionsChangePackageLot(CommonCase):
|
|
105
107
|
# failure callback
|
106
108
|
self.unreachable_func,
|
107
109
|
)
|
108
|
-
self.assertRecordValues(
|
110
|
+
self.assertRecordValues(
|
111
|
+
line, [{"lot_id": new_lot.id, "quantity_product_uom": 8}]
|
112
|
+
)
|
109
113
|
other_line = line.move_id.move_line_ids - line
|
110
114
|
self.assertRecordValues(
|
111
|
-
other_line, [{"lot_id": initial_lot.id, "
|
115
|
+
other_line, [{"lot_id": initial_lot.id, "quantity_product_uom": 2}]
|
112
116
|
)
|
113
117
|
# check that reservations have been updated
|
114
118
|
self.assert_quant_reserved_qty(line, lambda: 2, lot=initial_lot)
|
115
|
-
self.assert_quant_reserved_qty(
|
119
|
+
self.assert_quant_reserved_qty(
|
120
|
+
line, lambda: line.quantity_product_uom, lot=new_lot
|
121
|
+
)
|
116
122
|
|
117
123
|
def test_change_lot_zero_quant_error(self):
|
118
124
|
"""No quant in the location for the scanned lot
|
@@ -135,9 +141,13 @@ class TestActionsChangePackageLot(CommonCase):
|
|
135
141
|
lambda move_line, message=None: self.assertEqual(message, expected_message),
|
136
142
|
)
|
137
143
|
|
138
|
-
self.assertRecordValues(
|
144
|
+
self.assertRecordValues(
|
145
|
+
line, [{"lot_id": initial_lot.id, "quantity_product_uom": 10}]
|
146
|
+
)
|
139
147
|
# check that reservations have not been updated
|
140
|
-
self.assert_quant_reserved_qty(
|
148
|
+
self.assert_quant_reserved_qty(
|
149
|
+
line, lambda: line.quantity_product_uom, lot=initial_lot
|
150
|
+
)
|
141
151
|
self.assert_quant_reserved_qty(line, lambda: 0, lot=new_lot)
|
142
152
|
|
143
153
|
def test_change_lot_package_explode_ok(self):
|
@@ -169,7 +179,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
169
179
|
[
|
170
180
|
{
|
171
181
|
"lot_id": new_lot.id,
|
172
|
-
"
|
182
|
+
"quantity_product_uom": 10,
|
173
183
|
"package_id": False,
|
174
184
|
"package_level_id": False,
|
175
185
|
}
|
@@ -178,7 +188,9 @@ class TestActionsChangePackageLot(CommonCase):
|
|
178
188
|
|
179
189
|
# check that reservations have been updated
|
180
190
|
self.assert_quant_reserved_qty(line, lambda: 0, lot=initial_lot)
|
181
|
-
self.assert_quant_reserved_qty(
|
191
|
+
self.assert_quant_reserved_qty(
|
192
|
+
line, lambda: line.quantity_product_uom, lot=new_lot
|
193
|
+
)
|
182
194
|
|
183
195
|
def test_change_lot_reserved_qty_ok(self):
|
184
196
|
"""Scan a lot already reserved by other lines
|
@@ -210,15 +222,21 @@ class TestActionsChangePackageLot(CommonCase):
|
|
210
222
|
self.unreachable_func,
|
211
223
|
)
|
212
224
|
|
213
|
-
self.assertRecordValues(
|
225
|
+
self.assertRecordValues(
|
226
|
+
line, [{"lot_id": new_lot.id, "quantity_product_uom": 10}]
|
227
|
+
)
|
214
228
|
# line has been re-created
|
215
229
|
line2 = picking2.move_line_ids
|
216
|
-
self.assertRecordValues(
|
230
|
+
self.assertRecordValues(
|
231
|
+
line2, [{"lot_id": initial_lot.id, "quantity_product_uom": 10}]
|
232
|
+
)
|
217
233
|
|
218
234
|
# check that reservations have been updated
|
219
|
-
self.assert_quant_reserved_qty(line, lambda: line.reserved_qty, lot=new_lot)
|
220
235
|
self.assert_quant_reserved_qty(
|
221
|
-
|
236
|
+
line, lambda: line.quantity_product_uom, lot=new_lot
|
237
|
+
)
|
238
|
+
self.assert_quant_reserved_qty(
|
239
|
+
line2, lambda: line2.quantity_product_uom, lot=initial_lot
|
222
240
|
)
|
223
241
|
|
224
242
|
def test_change_lot_reserved_partial_qty_ok(self):
|
@@ -254,25 +272,31 @@ class TestActionsChangePackageLot(CommonCase):
|
|
254
272
|
self.unreachable_func,
|
255
273
|
)
|
256
274
|
|
257
|
-
self.assertRecordValues(
|
275
|
+
self.assertRecordValues(
|
276
|
+
line, [{"lot_id": new_lot.id, "quantity_product_uom": 8}]
|
277
|
+
)
|
258
278
|
other_line = picking.move_line_ids - line
|
259
279
|
self.assertRecordValues(
|
260
|
-
other_line, [{"lot_id": initial_lot.id, "
|
280
|
+
other_line, [{"lot_id": initial_lot.id, "quantity_product_uom": 2}]
|
261
281
|
)
|
262
282
|
# line has been re-created
|
263
283
|
line2 = picking2.move_line_ids
|
264
|
-
self.assertRecordValues(
|
284
|
+
self.assertRecordValues(
|
285
|
+
line2, [{"lot_id": initial_lot.id, "quantity_product_uom": 8}]
|
286
|
+
)
|
265
287
|
|
266
288
|
# check that reservations have been updated
|
267
|
-
self.assert_quant_reserved_qty(
|
289
|
+
self.assert_quant_reserved_qty(
|
290
|
+
line, lambda: line.quantity_product_uom, lot=new_lot
|
291
|
+
)
|
268
292
|
# both line2 and the line for the 2 remaining will re-reserve the initial lot
|
269
293
|
self.assert_quant_reserved_qty(
|
270
294
|
other_line,
|
271
|
-
lambda: line2.
|
295
|
+
lambda: line2.quantity_product_uom + other_line.quantity_product_uom,
|
272
296
|
lot=initial_lot,
|
273
297
|
)
|
274
298
|
|
275
|
-
def
|
299
|
+
def test_change_lot_reserved_qty_picked_error(self):
|
276
300
|
"""Scan a lot already reserved by other *picked* lines
|
277
301
|
|
278
302
|
Cannot "steal" lot from picked lines
|
@@ -290,7 +314,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
290
314
|
picking2.action_assign()
|
291
315
|
line2 = picking2.move_line_ids
|
292
316
|
self.assertEqual(line2.lot_id, new_lot)
|
293
|
-
line2.
|
317
|
+
line2._pick_qty(10.0)
|
294
318
|
|
295
319
|
expected_message = self.msg_store.cannot_change_lot_already_picked(new_lot)
|
296
320
|
self.change_package_lot.change_lot(
|
@@ -303,12 +327,19 @@ class TestActionsChangePackageLot(CommonCase):
|
|
303
327
|
)
|
304
328
|
|
305
329
|
# no changes
|
306
|
-
self.assertRecordValues(line, [{"lot_id": initial_lot.id, "reserved_qty": 10}])
|
307
330
|
self.assertRecordValues(
|
308
|
-
|
331
|
+
line, [{"lot_id": initial_lot.id, "quantity_product_uom": 10}]
|
332
|
+
)
|
333
|
+
self.assertRecordValues(
|
334
|
+
line2,
|
335
|
+
[{"lot_id": new_lot.id, "quantity_product_uom": 10, "qty_picked": 10.0}],
|
336
|
+
)
|
337
|
+
self.assert_quant_reserved_qty(
|
338
|
+
line, lambda: line.quantity_product_uom, lot=initial_lot
|
339
|
+
)
|
340
|
+
self.assert_quant_reserved_qty(
|
341
|
+
line2, lambda: line2.quantity_product_uom, lot=new_lot
|
309
342
|
)
|
310
|
-
self.assert_quant_reserved_qty(line, lambda: line.reserved_qty, lot=initial_lot)
|
311
|
-
self.assert_quant_reserved_qty(line2, lambda: line2.reserved_qty, lot=new_lot)
|
312
343
|
|
313
344
|
def test_change_lot_different_location_error(self):
|
314
345
|
"If the scanned lot is in a different location, we cannot process it"
|
@@ -333,7 +364,9 @@ class TestActionsChangePackageLot(CommonCase):
|
|
333
364
|
|
334
365
|
self.assertRecordValues(line, [{"lot_id": initial_lot.id}])
|
335
366
|
# check that reservations have not been updated
|
336
|
-
self.assert_quant_reserved_qty(
|
367
|
+
self.assert_quant_reserved_qty(
|
368
|
+
line, lambda: line.quantity_product_uom, lot=initial_lot
|
369
|
+
)
|
337
370
|
self.assert_quant_reserved_qty(line, lambda: 0, lot=new_lot)
|
338
371
|
|
339
372
|
def test_change_lot_in_several_packages_error(self):
|
@@ -398,7 +431,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
398
431
|
"package_id": new_package.id,
|
399
432
|
"result_package_id": new_package.id,
|
400
433
|
"lot_id": new_lot.id,
|
401
|
-
"
|
434
|
+
"quantity_product_uom": 10.0,
|
402
435
|
}
|
403
436
|
],
|
404
437
|
)
|
@@ -406,7 +439,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
406
439
|
# check that reservations have been updated
|
407
440
|
self.assert_quant_reserved_qty(line, lambda: 0, package=initial_package)
|
408
441
|
self.assert_quant_reserved_qty(
|
409
|
-
line, lambda: line.
|
442
|
+
line, lambda: line.quantity_product_uom, package=new_package
|
410
443
|
)
|
411
444
|
|
412
445
|
def test_change_lot_in_package_no_initial_package_ok(self):
|
@@ -438,7 +471,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
438
471
|
"package_id": new_package.id,
|
439
472
|
"result_package_id": new_package.id,
|
440
473
|
"lot_id": new_lot.id,
|
441
|
-
"
|
474
|
+
"quantity_product_uom": 10.0,
|
442
475
|
}
|
443
476
|
],
|
444
477
|
)
|
@@ -446,7 +479,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
446
479
|
# check that reservations have been updated
|
447
480
|
self.assert_quant_reserved_qty(line, lambda: 0, lot=initial_lot)
|
448
481
|
self.assert_quant_reserved_qty(
|
449
|
-
line, lambda: line.
|
482
|
+
line, lambda: line.quantity_product_uom, package=new_package
|
450
483
|
)
|
451
484
|
|
452
485
|
def test_change_pack_different_content_error(self):
|
@@ -547,7 +580,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
547
580
|
# we are no longer moving an entire package
|
548
581
|
"result_package_id": False,
|
549
582
|
"lot_id": new_lot_a.id,
|
550
|
-
"
|
583
|
+
"quantity_product_uom": 10.0,
|
551
584
|
}
|
552
585
|
],
|
553
586
|
)
|
@@ -559,17 +592,17 @@ class TestActionsChangePackageLot(CommonCase):
|
|
559
592
|
# we are no longer moving an entire package
|
560
593
|
"result_package_id": False,
|
561
594
|
"lot_id": initial_lot_b.id,
|
562
|
-
"
|
595
|
+
"quantity_product_uom": 10.0,
|
563
596
|
}
|
564
597
|
],
|
565
598
|
)
|
566
599
|
# check that reservations have been updated
|
567
600
|
self.assert_quant_reserved_qty(line1, lambda: 0, package=initial_package)
|
568
601
|
self.assert_quant_reserved_qty(
|
569
|
-
line2, lambda: line2.
|
602
|
+
line2, lambda: line2.quantity_product_uom, package=initial_package
|
570
603
|
)
|
571
604
|
self.assert_quant_reserved_qty(
|
572
|
-
line1, lambda: line1.
|
605
|
+
line1, lambda: line1.quantity_product_uom, package=new_package
|
573
606
|
)
|
574
607
|
self.assert_quant_reserved_qty(line2, lambda: 0, package=new_package)
|
575
608
|
|
@@ -613,7 +646,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
613
646
|
self.assert_quant_package_qty(self.shelf2, new_package, lambda: 0)
|
614
647
|
self.assert_quant_reserved_qty(line, lambda: 0, package=initial_package)
|
615
648
|
self.assert_quant_reserved_qty(
|
616
|
-
line, lambda: line.
|
649
|
+
line, lambda: line.quantity_product_uom, package=new_package
|
617
650
|
)
|
618
651
|
|
619
652
|
def test_change_pack_different_location_reserved_package(self):
|
@@ -665,13 +698,13 @@ class TestActionsChangePackageLot(CommonCase):
|
|
665
698
|
"package_id": new_package.id,
|
666
699
|
"result_package_id": new_package.id,
|
667
700
|
"location_id": self.shelf1.id,
|
668
|
-
"
|
701
|
+
"quantity_product_uom": 10.0,
|
669
702
|
},
|
670
703
|
{
|
671
704
|
"package_id": initial_package.id,
|
672
705
|
"result_package_id": initial_package.id,
|
673
706
|
"location_id": self.shelf1.id,
|
674
|
-
"
|
707
|
+
"quantity_product_uom": 10.0,
|
675
708
|
},
|
676
709
|
],
|
677
710
|
)
|
@@ -684,13 +717,13 @@ class TestActionsChangePackageLot(CommonCase):
|
|
684
717
|
# for the initial package anymore
|
685
718
|
self.assert_quant_package_qty(self.shelf2, new_package, lambda: 0)
|
686
719
|
self.assert_quant_reserved_qty(
|
687
|
-
line, lambda: line.
|
720
|
+
line, lambda: line.quantity_product_uom, package=new_package
|
688
721
|
)
|
689
722
|
self.assert_quant_reserved_qty(
|
690
|
-
line2, lambda: line2.
|
723
|
+
line2, lambda: line2.quantity_product_uom, package=initial_package
|
691
724
|
)
|
692
725
|
|
693
|
-
def
|
726
|
+
def test_change_pack_different_location_reserved_package_qty_picked(self):
|
694
727
|
initial_package = self._create_package_in_location(
|
695
728
|
self.shelf1, [self.PackageContent(self.product_a, 10, lot=None)]
|
696
729
|
)
|
@@ -709,7 +742,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
709
742
|
picking2.action_assign()
|
710
743
|
line2 = picking2.move_line_ids
|
711
744
|
self.assertEqual(line2.package_id, new_package)
|
712
|
-
line2.
|
745
|
+
line2._pick_qty(10.0)
|
713
746
|
|
714
747
|
# The new package was supposed to be in shelf2 but is in fact in shelf1.
|
715
748
|
# The package has already been picked in shelf2 (unlikely to happen...
|
@@ -736,13 +769,13 @@ class TestActionsChangePackageLot(CommonCase):
|
|
736
769
|
"package_id": initial_package.id,
|
737
770
|
"result_package_id": initial_package.id,
|
738
771
|
"location_id": self.shelf1.id,
|
739
|
-
"
|
772
|
+
"quantity_product_uom": 10.0,
|
740
773
|
},
|
741
774
|
{
|
742
775
|
"package_id": new_package.id,
|
743
776
|
"result_package_id": new_package.id,
|
744
777
|
"location_id": self.shelf2.id,
|
745
|
-
"
|
778
|
+
"quantity_product_uom": 10.0,
|
746
779
|
},
|
747
780
|
],
|
748
781
|
)
|
@@ -755,10 +788,10 @@ class TestActionsChangePackageLot(CommonCase):
|
|
755
788
|
)
|
756
789
|
self.assert_quant_package_qty(self.shelf2, new_package, lambda: 10.0)
|
757
790
|
self.assert_quant_reserved_qty(
|
758
|
-
line, lambda: line.
|
791
|
+
line, lambda: line.quantity_product_uom, package=initial_package
|
759
792
|
)
|
760
793
|
self.assert_quant_reserved_qty(
|
761
|
-
line2, lambda: line2.
|
794
|
+
line2, lambda: line2.quantity_product_uom, package=new_package
|
762
795
|
)
|
763
796
|
|
764
797
|
def test_change_pack_lot_change_pack_less_qty_ok(self):
|
@@ -778,7 +811,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
778
811
|
# since we don't move the entire package (10 out of 100), no
|
779
812
|
# result package
|
780
813
|
"result_package_id": False,
|
781
|
-
"
|
814
|
+
"quantity_product_uom": 10.0,
|
782
815
|
}
|
783
816
|
],
|
784
817
|
)
|
@@ -807,7 +840,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
807
840
|
{
|
808
841
|
"package_id": new_package.id,
|
809
842
|
"result_package_id": new_package.id,
|
810
|
-
"
|
843
|
+
"quantity_product_uom": 10.0,
|
811
844
|
}
|
812
845
|
],
|
813
846
|
)
|
@@ -816,13 +849,13 @@ class TestActionsChangePackageLot(CommonCase):
|
|
816
849
|
# check that reservations have been updated
|
817
850
|
self.assert_quant_reserved_qty(line, lambda: 0, package=initial_package)
|
818
851
|
self.assert_quant_reserved_qty(
|
819
|
-
line, lambda: line.
|
852
|
+
line, lambda: line.quantity_product_uom, package=new_package
|
820
853
|
)
|
821
854
|
|
822
855
|
def test_change_pack_steal_from_other_move_line(self):
|
823
856
|
"""Exchange pack with another line
|
824
857
|
|
825
|
-
When we scan the package used on another line not picked yet (
|
858
|
+
When we scan the package used on another line not picked yet (qty_picked
|
826
859
|
== 0), we unreserve the other line and use its package. The other line
|
827
860
|
is reserved again and should reserve the package used initially on our
|
828
861
|
move line.
|
@@ -861,7 +894,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
861
894
|
"package_id": package2.id,
|
862
895
|
"result_package_id": package2.id,
|
863
896
|
"state": "assigned",
|
864
|
-
"
|
897
|
+
"quantity_product_uom": 10.0,
|
865
898
|
}
|
866
899
|
],
|
867
900
|
)
|
@@ -872,7 +905,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
872
905
|
"package_id": package1.id,
|
873
906
|
"result_package_id": package1.id,
|
874
907
|
"state": "assigned",
|
875
|
-
"
|
908
|
+
"quantity_product_uom": 10.0,
|
876
909
|
}
|
877
910
|
],
|
878
911
|
)
|
@@ -887,20 +920,20 @@ class TestActionsChangePackageLot(CommonCase):
|
|
887
920
|
# check that reservations have been updated
|
888
921
|
self.assert_quant_reserved_qty(
|
889
922
|
picking1.move_line_ids,
|
890
|
-
lambda: picking1.move_line_ids.
|
923
|
+
lambda: picking1.move_line_ids.quantity_product_uom,
|
891
924
|
package=package2,
|
892
925
|
)
|
893
926
|
self.assert_quant_reserved_qty(
|
894
927
|
picking2.move_line_ids,
|
895
|
-
lambda: picking2.move_line_ids.
|
928
|
+
lambda: picking2.move_line_ids.quantity_product_uom,
|
896
929
|
package=package1,
|
897
930
|
)
|
898
931
|
|
899
|
-
def
|
900
|
-
"""Try to exchange pack with other line with
|
932
|
+
def test_other_line_with_qty_picked(self):
|
933
|
+
"""Try to exchange pack with other line with qty_picked
|
901
934
|
|
902
935
|
When we scan the package used on another line which has been picked
|
903
|
-
(
|
936
|
+
(qty_picked > 0), do not unreserve the other line.
|
904
937
|
"""
|
905
938
|
# create 2 picking, each with its own package
|
906
939
|
package1 = self._create_package_in_location(
|
@@ -917,7 +950,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
917
950
|
|
918
951
|
line1 = picking1.move_line_ids
|
919
952
|
line2 = picking2.move_line_ids
|
920
|
-
line2.
|
953
|
+
line2._pick_qty(10)
|
921
954
|
|
922
955
|
expected_msg = (
|
923
956
|
f"Package {package2.display_name} does not contain available product "
|
@@ -967,12 +1000,12 @@ class TestActionsChangePackageLot(CommonCase):
|
|
967
1000
|
# check that reservations have been updated
|
968
1001
|
self.assert_quant_reserved_qty(
|
969
1002
|
picking1.move_line_ids,
|
970
|
-
lambda: picking1.move_line_ids.
|
1003
|
+
lambda: picking1.move_line_ids.quantity_product_uom,
|
971
1004
|
package=package1,
|
972
1005
|
)
|
973
1006
|
self.assert_quant_reserved_qty(
|
974
1007
|
picking2.move_line_ids,
|
975
|
-
lambda: picking2.move_line_ids.
|
1008
|
+
lambda: picking2.move_line_ids.quantity_product_uom,
|
976
1009
|
package=package2,
|
977
1010
|
)
|
978
1011
|
|
@@ -980,7 +1013,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
980
1013
|
"""Try to exchange pack with a package partially picked
|
981
1014
|
|
982
1015
|
When we scan the package used on another line which has been picked
|
983
|
-
(
|
1016
|
+
(qty_picked > 0), but the new package still has unreserved quantity:
|
984
1017
|
|
985
1018
|
* the current line is updated for the remaining unreserved quantity
|
986
1019
|
* a new line is created for the remaining
|
@@ -1007,7 +1040,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
1007
1040
|
|
1008
1041
|
# this line is picked, should not be changed, but we still have
|
1009
1042
|
# 2 units in package2
|
1010
|
-
line2.
|
1043
|
+
line2.picked = True
|
1011
1044
|
|
1012
1045
|
self.change_package_lot.change_package(
|
1013
1046
|
line1,
|
@@ -1030,7 +1063,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
1030
1063
|
"state": "assigned",
|
1031
1064
|
# as the remaining was 2 units, the line is
|
1032
1065
|
# changed to take only 2
|
1033
|
-
"
|
1066
|
+
"quantity_product_uom": 2.0,
|
1034
1067
|
}
|
1035
1068
|
],
|
1036
1069
|
)
|
@@ -1043,7 +1076,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
1043
1076
|
# not moved entirely by this transfer
|
1044
1077
|
"result_package_id": False,
|
1045
1078
|
"state": "assigned",
|
1046
|
-
"
|
1079
|
+
"quantity_product_uom": 8.0,
|
1047
1080
|
}
|
1048
1081
|
],
|
1049
1082
|
)
|
@@ -1062,7 +1095,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
1062
1095
|
"result_package_id": False,
|
1063
1096
|
"state": "assigned",
|
1064
1097
|
# remaining qty for the 1st move
|
1065
|
-
"
|
1098
|
+
"quantity_product_uom": 8.0,
|
1066
1099
|
}
|
1067
1100
|
],
|
1068
1101
|
)
|
@@ -1076,11 +1109,11 @@ class TestActionsChangePackageLot(CommonCase):
|
|
1076
1109
|
self.assertFalse(picking1.package_level_ids)
|
1077
1110
|
self.assertFalse(picking2.package_level_ids)
|
1078
1111
|
|
1079
|
-
def
|
1112
|
+
def FIXME__test_package_2_lines_1_move(self):
|
1080
1113
|
"""Keep picked move line if we have 2 lines on a move
|
1081
1114
|
|
1082
1115
|
Create a situation where we have 2 move lines on a move, with different
|
1083
|
-
packages, 1 one of them is already picked (
|
1116
|
+
packages, 1 one of them is already picked (qty_picked > 0), we change the
|
1084
1117
|
package on the second one: the first one must not be changed.
|
1085
1118
|
"""
|
1086
1119
|
package1 = self._create_package_in_location(
|
@@ -1105,7 +1138,7 @@ class TestActionsChangePackageLot(CommonCase):
|
|
1105
1138
|
)
|
1106
1139
|
|
1107
1140
|
# this line is picked and must not be changed
|
1108
|
-
line1.
|
1141
|
+
line1._pick_qty(line1.quantity)
|
1109
1142
|
|
1110
1143
|
# as we change for package2, the line should get only the remaining
|
1111
1144
|
# part of the package
|
@@ -1127,14 +1160,14 @@ class TestActionsChangePackageLot(CommonCase):
|
|
1127
1160
|
{
|
1128
1161
|
"package_id": package1.id,
|
1129
1162
|
"state": "assigned",
|
1130
|
-
"
|
1131
|
-
"
|
1163
|
+
"quantity_product_uom": 4.0,
|
1164
|
+
"qty_picked": 4.0,
|
1132
1165
|
},
|
1133
1166
|
{
|
1134
1167
|
"package_id": package3.id,
|
1135
1168
|
"state": "assigned",
|
1136
|
-
"
|
1137
|
-
"
|
1169
|
+
"quantity_product_uom": 6.0,
|
1170
|
+
"qty_picked": 0.0,
|
1138
1171
|
},
|
1139
1172
|
],
|
1140
1173
|
)
|
@@ -54,7 +54,7 @@ class ActionsDataCase(ActionsDataCaseBase):
|
|
54
54
|
"barcode": location.name,
|
55
55
|
"operation_progress": {
|
56
56
|
"done": 0.0,
|
57
|
-
"to_do":
|
57
|
+
"to_do": 323.0,
|
58
58
|
},
|
59
59
|
}
|
60
60
|
self.assertDictEqual(data, expected)
|
@@ -178,7 +178,7 @@ class ActionsDataCase(ActionsDataCaseBase):
|
|
178
178
|
"partner": {"id": self.customer.id, "name": self.customer.name},
|
179
179
|
"carrier": {"id": carrier.id, "name": carrier.name},
|
180
180
|
"ship_carrier": None,
|
181
|
-
"progress":
|
181
|
+
"progress": 100.0,
|
182
182
|
"priority": "0",
|
183
183
|
}
|
184
184
|
self.assertEqual(data.pop("scheduled_date").split("T")[0], "2020-08-03")
|
@@ -214,20 +214,21 @@ class ActionsDataCase(ActionsDataCaseBase):
|
|
214
214
|
result_package = self.env["stock.quant.package"].create(
|
215
215
|
{"product_packaging_id": self.packaging.id}
|
216
216
|
)
|
217
|
-
move_line.
|
217
|
+
move_line.result_package_id = result_package
|
218
|
+
move_line._pick_qty(3.0)
|
218
219
|
data = self.data.move_line(move_line)
|
219
220
|
self.assert_schema(self.schema.move_line(), data)
|
220
221
|
self.assertIn(self.move_a.state, ["partially_available", "assigned", "done"])
|
221
222
|
expected = {
|
222
223
|
"id": move_line.id,
|
223
224
|
"qty_done": 3.0,
|
224
|
-
"quantity": move_line.
|
225
|
+
"quantity": move_line.quantity,
|
225
226
|
"product": self._expected_product(self.product_a),
|
226
227
|
"lot": None,
|
227
228
|
"package_src": {
|
228
229
|
"id": move_line.package_id.id,
|
229
230
|
"name": move_line.package_id.name,
|
230
|
-
"weight":
|
231
|
+
"weight": move_line.package_id.shopfloor_weight,
|
231
232
|
"storage_type": None,
|
232
233
|
"total_quantity": sum(
|
233
234
|
move_line.package_id.quant_ids.mapped("quantity")
|
@@ -236,14 +237,13 @@ class ActionsDataCase(ActionsDataCaseBase):
|
|
236
237
|
"package_dest": {
|
237
238
|
"id": result_package.id,
|
238
239
|
"name": result_package.name,
|
239
|
-
"weight":
|
240
|
+
"weight": move_line.package_id.shopfloor_weight,
|
240
241
|
"storage_type": None,
|
241
242
|
"total_quantity": sum(result_package.quant_ids.mapped("quantity")),
|
242
243
|
},
|
243
244
|
"location_src": self._expected_location(move_line.location_id),
|
244
245
|
"location_dest": self._expected_location(move_line.location_dest_id),
|
245
246
|
"priority": "1",
|
246
|
-
"progress": 30.0,
|
247
247
|
}
|
248
248
|
self.assertDictEqual(data, expected)
|
249
249
|
data = self.data.move_line(move_line, with_package_move_line_count=True)
|
@@ -257,8 +257,8 @@ class ActionsDataCase(ActionsDataCaseBase):
|
|
257
257
|
self.assert_schema(self.schema.move_line(), data)
|
258
258
|
expected = {
|
259
259
|
"id": move_line.id,
|
260
|
-
"qty_done": 0
|
261
|
-
"quantity": move_line.
|
260
|
+
"qty_done": 0,
|
261
|
+
"quantity": move_line.quantity,
|
262
262
|
"product": self._expected_product(self.product_b),
|
263
263
|
"lot": {
|
264
264
|
"id": move_line.lot_id.id,
|
@@ -271,7 +271,6 @@ class ActionsDataCase(ActionsDataCaseBase):
|
|
271
271
|
"location_src": self._expected_location(move_line.location_id),
|
272
272
|
"location_dest": self._expected_location(move_line.location_dest_id),
|
273
273
|
"priority": "1",
|
274
|
-
"progress": 0.0,
|
275
274
|
}
|
276
275
|
self.assertDictEqual(data, expected)
|
277
276
|
|
@@ -282,8 +281,8 @@ class ActionsDataCase(ActionsDataCaseBase):
|
|
282
281
|
self.assertIn(self.move_a.state, ["partially_available", "assigned", "done"])
|
283
282
|
expected = {
|
284
283
|
"id": move_line.id,
|
285
|
-
"qty_done": 0
|
286
|
-
"quantity": move_line.
|
284
|
+
"qty_done": 0,
|
285
|
+
"quantity": move_line.quantity,
|
287
286
|
"product": self._expected_product(self.product_c),
|
288
287
|
"lot": {
|
289
288
|
"id": move_line.lot_id.id,
|
@@ -294,7 +293,7 @@ class ActionsDataCase(ActionsDataCaseBase):
|
|
294
293
|
"package_src": {
|
295
294
|
"id": move_line.package_id.id,
|
296
295
|
"name": move_line.package_id.name,
|
297
|
-
"weight": 30,
|
296
|
+
"weight": 30.0,
|
298
297
|
"storage_type": None,
|
299
298
|
"total_quantity": sum(
|
300
299
|
move_line.package_id.quant_ids.mapped("quantity")
|
@@ -303,7 +302,7 @@ class ActionsDataCase(ActionsDataCaseBase):
|
|
303
302
|
"package_dest": {
|
304
303
|
"id": move_line.result_package_id.id,
|
305
304
|
"name": move_line.result_package_id.name,
|
306
|
-
"weight": 0,
|
305
|
+
"weight": 30.0,
|
307
306
|
"storage_type": None,
|
308
307
|
"total_quantity": sum(
|
309
308
|
move_line.result_package_id.quant_ids.mapped("quantity")
|
@@ -312,7 +311,6 @@ class ActionsDataCase(ActionsDataCaseBase):
|
|
312
311
|
"location_src": self._expected_location(move_line.location_id),
|
313
312
|
"location_dest": self._expected_location(move_line.location_dest_id),
|
314
313
|
"priority": "1",
|
315
|
-
"progress": 0.0,
|
316
314
|
}
|
317
315
|
self.assertDictEqual(data, expected)
|
318
316
|
data = self.data.move_line(move_line, with_package_move_line_count=True)
|
@@ -327,8 +325,8 @@ class ActionsDataCase(ActionsDataCaseBase):
|
|
327
325
|
self.assert_schema(self.schema.move_line(), data)
|
328
326
|
expected = {
|
329
327
|
"id": move_line.id,
|
330
|
-
"qty_done": 0
|
331
|
-
"quantity": move_line.
|
328
|
+
"qty_done": 0,
|
329
|
+
"quantity": move_line.quantity,
|
332
330
|
"product": self._expected_product(self.product_d),
|
333
331
|
"lot": None,
|
334
332
|
"package_src": None,
|
@@ -336,7 +334,6 @@ class ActionsDataCase(ActionsDataCaseBase):
|
|
336
334
|
"location_src": self._expected_location(move_line.location_id),
|
337
335
|
"location_dest": self._expected_location(move_line.location_dest_id),
|
338
336
|
"priority": "1",
|
339
|
-
"progress": 0.0,
|
340
337
|
}
|
341
338
|
self.assertDictEqual(data, expected)
|
342
339
|
|
@@ -346,8 +343,8 @@ class ActionsDataCase(ActionsDataCaseBase):
|
|
346
343
|
self.assert_schema(self.schema.move_line(with_picking=True), data)
|
347
344
|
expected = {
|
348
345
|
"id": move_line.id,
|
349
|
-
"qty_done": 0
|
350
|
-
"quantity": move_line.
|
346
|
+
"qty_done": 0,
|
347
|
+
"quantity": move_line.quantity,
|
351
348
|
"product": self._expected_product(self.product_d),
|
352
349
|
"lot": None,
|
353
350
|
"package_src": None,
|
@@ -356,7 +353,6 @@ class ActionsDataCase(ActionsDataCaseBase):
|
|
356
353
|
"location_dest": self._expected_location(move_line.location_dest_id),
|
357
354
|
"picking": self.data.picking(move_line.picking_id),
|
358
355
|
"priority": "1",
|
359
|
-
"progress": 0.0,
|
360
356
|
}
|
361
357
|
self.assertDictEqual(data, expected)
|
362
358
|
|