odoo-addon-shopfloor 18.0.0.1.2__py3-none-any.whl → 18.0.0.2.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 (40) hide show
  1. odoo/addons/shopfloor/README.rst +1 -1
  2. odoo/addons/shopfloor/__manifest__.py +1 -1
  3. odoo/addons/shopfloor/actions/message.py +3 -3
  4. odoo/addons/shopfloor/models/stock_move_line.py +2 -2
  5. odoo/addons/shopfloor/models/stock_picking.py +2 -5
  6. odoo/addons/shopfloor/services/checkout.py +64 -54
  7. odoo/addons/shopfloor/services/cluster_picking.py +3 -2
  8. odoo/addons/shopfloor/services/delivery.py +14 -15
  9. odoo/addons/shopfloor/services/zone_picking.py +3 -2
  10. odoo/addons/shopfloor/static/description/index.html +1 -1
  11. odoo/addons/shopfloor/tests/__init__.py +32 -31
  12. odoo/addons/shopfloor/tests/common.py +3 -1
  13. odoo/addons/shopfloor/tests/test_checkout_auto_post.py +9 -8
  14. odoo/addons/shopfloor/tests/test_checkout_base.py +1 -1
  15. odoo/addons/shopfloor/tests/test_checkout_cancel_line.py +12 -8
  16. odoo/addons/shopfloor/tests/test_checkout_done.py +5 -5
  17. odoo/addons/shopfloor/tests/test_checkout_list_delivery_packaging.py +0 -2
  18. odoo/addons/shopfloor/tests/test_checkout_list_package.py +19 -12
  19. odoo/addons/shopfloor/tests/test_checkout_new_package.py +7 -7
  20. odoo/addons/shopfloor/tests/test_checkout_no_package.py +6 -6
  21. odoo/addons/shopfloor/tests/test_checkout_scan.py +1 -1
  22. odoo/addons/shopfloor/tests/test_checkout_scan_dest_location.py +2 -2
  23. odoo/addons/shopfloor/tests/test_checkout_scan_line.py +3 -1
  24. odoo/addons/shopfloor/tests/test_checkout_scan_package_action.py +14 -14
  25. odoo/addons/shopfloor/tests/test_checkout_scan_package_action_no_prefill_qty.py +9 -9
  26. odoo/addons/shopfloor/tests/test_checkout_select_line.py +1 -1
  27. odoo/addons/shopfloor/tests/test_checkout_select_package_base.py +6 -4
  28. odoo/addons/shopfloor/tests/test_checkout_set_qty.py +12 -11
  29. odoo/addons/shopfloor/tests/test_checkout_summary.py +2 -2
  30. odoo/addons/shopfloor/tests/test_delivery_base.py +3 -3
  31. odoo/addons/shopfloor/tests/test_delivery_done.py +1 -2
  32. odoo/addons/shopfloor/tests/test_delivery_reset_qty_done_line.py +2 -2
  33. odoo/addons/shopfloor/tests/test_delivery_reset_qty_done_pack.py +2 -2
  34. odoo/addons/shopfloor/tests/test_delivery_scan_deliver.py +11 -11
  35. odoo/addons/shopfloor/tests/test_delivery_set_qty_done_line.py +1 -1
  36. odoo/addons/shopfloor/tests/test_delivery_set_qty_done_pack.py +1 -1
  37. {odoo_addon_shopfloor-18.0.0.1.2.dist-info → odoo_addon_shopfloor-18.0.0.2.0.dist-info}/METADATA +2 -2
  38. {odoo_addon_shopfloor-18.0.0.1.2.dist-info → odoo_addon_shopfloor-18.0.0.2.0.dist-info}/RECORD +40 -40
  39. {odoo_addon_shopfloor-18.0.0.1.2.dist-info → odoo_addon_shopfloor-18.0.0.2.0.dist-info}/WHEEL +1 -1
  40. {odoo_addon_shopfloor-18.0.0.1.2.dist-info → odoo_addon_shopfloor-18.0.0.2.0.dist-info}/top_level.txt +0 -0
@@ -14,11 +14,11 @@ class CheckoutAutoPostCase(CheckoutCommonCase):
14
14
  selected_move_line_a = picking.move_line_ids.filtered(
15
15
  lambda x: x.product_id == self.product_a
16
16
  )
17
- selected_move_line_a.qty_done = 7
17
+ selected_move_line_a.qty_picked = 7
18
18
  selected_move_line_b = picking.move_line_ids.filtered(
19
19
  lambda x: x.product_id == self.product_b
20
20
  )
21
- selected_move_line_b.qty_done = 9
21
+ selected_move_line_b.qty_picked = 9
22
22
  selected_move_line_c = picking.move_line_ids.filtered(
23
23
  lambda x: x.product_id == self.product_c
24
24
  )
@@ -44,10 +44,10 @@ class CheckoutAutoPostCase(CheckoutCommonCase):
44
44
  )
45
45
  self.assertEqual(picking, selected_move_line_c.picking_id)
46
46
 
47
- # The lines in the new picking must have the expected qty_done,
47
+ # The lines in the new picking must have the expected picked qty,
48
48
  # and the split picking must be marked as "done".
49
- self.assertEqual(selected_move_line_a.qty_done, 7)
50
- self.assertEqual(selected_move_line_b.qty_done, 9)
49
+ self.assertEqual(selected_move_line_a.qty_picked, 7)
50
+ self.assertEqual(selected_move_line_b.qty_picked, 9)
51
51
  self.assertEqual(selected_move_line_a.picking_id.state, "done")
52
52
 
53
53
  # In the original picking, we should have three lines:
@@ -63,6 +63,7 @@ class CheckoutAutoPostCase(CheckoutCommonCase):
63
63
  self.assertEqual(line_b_in_original_picking.quantity, 11)
64
64
  self.assertEqual(selected_move_line_c.quantity, 30)
65
65
 
66
- self.assertEqual(line_a_in_original_picking.qty_done, 0)
67
- self.assertEqual(line_b_in_original_picking.qty_done, 0)
68
- self.assertEqual(selected_move_line_c.qty_done, 0)
66
+ self.assertEqual(line_a_in_original_picking.qty_picked, 0)
67
+ self.assertEqual(line_b_in_original_picking.qty_picked, 0)
68
+ self.assertEqual(selected_move_line_c.qty_picked, 0)
69
+ self.assertFalse(selected_move_line_c.picked)
@@ -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.quantity)})", # noqa
94
+ f"({line.product_id.name} : {str(line.qty_picked)} > {str(line.quantity)})", # noqa
95
95
  },
96
96
  )
@@ -35,7 +35,7 @@ class CheckoutRemovePackageCase(CheckoutCommonCase):
35
35
  new_package = self.env["stock.quant.package"].create({})
36
36
  (pack1_lines | raw_line).write(
37
37
  {
38
- "qty_done": 10,
38
+ "qty_picked": 10,
39
39
  "result_package_id": new_package.id,
40
40
  "shopfloor_checkout_done": True,
41
41
  }
@@ -43,7 +43,7 @@ class CheckoutRemovePackageCase(CheckoutCommonCase):
43
43
  new_package2 = self.env["stock.quant.package"].create({})
44
44
  pack2_lines.write(
45
45
  {
46
- "qty_done": 10,
46
+ "qty_picked": 10,
47
47
  "result_package_id": new_package2.id,
48
48
  "shopfloor_checkout_done": True,
49
49
  }
@@ -59,26 +59,30 @@ class CheckoutRemovePackageCase(CheckoutCommonCase):
59
59
  pack1_lines + raw_line + pack2_lines,
60
60
  [
61
61
  {
62
- "qty_done": 0,
62
+ "qty_picked": 0,
63
+ "picked": False,
63
64
  # reset to origin package
64
65
  "result_package_id": pack1_lines.mapped("package_id").id,
65
66
  "shopfloor_checkout_done": False,
66
67
  },
67
68
  {
68
- "qty_done": 0,
69
+ "qty_picked": 0,
70
+ "picked": False,
69
71
  # reset to origin package
70
72
  "result_package_id": pack1_lines.mapped("package_id").id,
71
73
  "shopfloor_checkout_done": False,
72
74
  },
73
75
  {
74
- "qty_done": 0,
76
+ "qty_picked": 0,
77
+ "picked": False,
75
78
  # result to an empty package (raw product)
76
79
  "result_package_id": False,
77
80
  "shopfloor_checkout_done": False,
78
81
  },
79
82
  # different package, leave untouched
80
83
  {
81
- "qty_done": 10,
84
+ "qty_picked": 10,
85
+ "picked": True,
82
86
  "result_package_id": new_package2.id,
83
87
  "shopfloor_checkout_done": True,
84
88
  },
@@ -97,7 +101,7 @@ class CheckoutRemovePackageCase(CheckoutCommonCase):
97
101
 
98
102
  raw_line = self.raw_move.move_line_ids
99
103
 
100
- raw_line.write({"qty_done": 10, "shopfloor_checkout_done": True})
104
+ raw_line.write({"qty_picked": 10, "shopfloor_checkout_done": True})
101
105
 
102
106
  # and now, we want to drop the new_package
103
107
  response = self.service.dispatch(
@@ -107,7 +111,7 @@ class CheckoutRemovePackageCase(CheckoutCommonCase):
107
111
 
108
112
  self.assertRecordValues(
109
113
  raw_line,
110
- [{"qty_done": 0, "shopfloor_checkout_done": False}],
114
+ [{"qty_picked": 0, "picked": False, "shopfloor_checkout_done": False}],
111
115
  )
112
116
 
113
117
  self.assert_response(
@@ -10,7 +10,7 @@ class CheckoutDoneCase(CheckoutCommonCase):
10
10
  self._fill_stock_for_moves(picking.move_ids, in_package=True)
11
11
  picking.action_assign()
12
12
  # line is done
13
- picking.move_line_ids.write({"qty_done": 10, "shopfloor_checkout_done": True})
13
+ picking.move_line_ids.write({"qty_picked": 10, "shopfloor_checkout_done": True})
14
14
  response = self.service.dispatch("done", params={"picking_id": picking.id})
15
15
 
16
16
  self.assertRecordValues(picking, [{"state": "done"}])
@@ -37,8 +37,8 @@ class CheckoutDonePartialCase(CheckoutCommonCase):
37
37
  picking.action_assign()
38
38
  cls.line1 = picking.move_line_ids[0]
39
39
  cls.line2 = picking.move_line_ids[1]
40
- cls.line1.write({"qty_done": 10, "shopfloor_checkout_done": True})
41
- cls.line2.write({"qty_done": 2, "shopfloor_checkout_done": True})
40
+ cls.line1.write({"qty_picked": 10, "shopfloor_checkout_done": True})
41
+ cls.line2.write({"qty_picked": 2, "shopfloor_checkout_done": True})
42
42
 
43
43
  cls.dest_location = picking.location_dest_id
44
44
  cls.child_location = (
@@ -119,12 +119,12 @@ class CheckoutDoneRawUnpackedCase(CheckoutCommonCase):
119
119
  cls.package = cls.env["stock.quant.package"].create({})
120
120
  cls.line1.write(
121
121
  {
122
- "qty_done": 10,
122
+ "qty_picked": 10,
123
123
  "shopfloor_checkout_done": True,
124
124
  "result_package_id": cls.package.id,
125
125
  }
126
126
  )
127
- cls.line2.write({"qty_done": 10, "shopfloor_checkout_done": False})
127
+ cls.line2.write({"qty_picked": 10, "shopfloor_checkout_done": False})
128
128
 
129
129
  def test_done_partial(self):
130
130
  # line is done
@@ -105,8 +105,6 @@ class CheckoutListDeliveryPackagingCase(CheckoutCommonCase, CheckoutSelectPackag
105
105
  self._fill_stock_for_moves(self.picking.move_ids, in_package=True)
106
106
  self.picking.action_assign()
107
107
  selected_lines = self.picking.move_line_ids
108
- # for line in selected_lines:
109
- # line.qty_done = line.quantity
110
108
  response = self.service.dispatch(
111
109
  "list_delivery_packaging",
112
110
  params={
@@ -137,9 +137,9 @@ 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.quantity
141
- cls.move_line2.qty_done = cls.move_line2.quantity
142
- cls.move_line3.qty_done = 0
140
+ cls.move_line1.qty_picked = cls.move_line1.quantity
141
+ cls.move_line2.qty_picked = cls.move_line2.quantity
142
+ cls.move_line3.qty_picked = 0
143
143
 
144
144
  cls.picking = picking
145
145
 
@@ -161,7 +161,7 @@ class CheckoutScanSetDestPackageCase(CheckoutCommonCase, SelectDestPackageMixin)
161
161
  "result_package_id": self.delivery_package.id,
162
162
  "shopfloor_checkout_done": True,
163
163
  },
164
- # qty_done was zero so we don't set it as packed
164
+ # picked qty was zero so we don't set it as packed
165
165
  {"result_package_id": self.pack1.id, "shopfloor_checkout_done": False},
166
166
  ],
167
167
  )
@@ -232,9 +232,9 @@ class CheckoutScanSetDestPackageCase(CheckoutCommonCase, SelectDestPackageMixin)
232
232
  )
233
233
  self._assert_package_set(response)
234
234
 
235
- def test_set_dest_package_ok_on_partial_qty_done(self):
235
+ def test_set_dest_package_ok_on_partial_qty_picked(self):
236
236
  # Partially process line three 3 quantiy out of 10
237
- self.move_line3.qty_done = 3
237
+ self.move_line3.qty_picked = 3
238
238
  response = self.service.dispatch(
239
239
  "set_dest_package",
240
240
  params={
@@ -250,23 +250,30 @@ class CheckoutScanSetDestPackageCase(CheckoutCommonCase, SelectDestPackageMixin)
250
250
  {
251
251
  "result_package_id": self.delivery_package.id,
252
252
  "shopfloor_checkout_done": True,
253
+ "quantity": 10,
254
+ "qty_picked": 10,
255
+ "picked": True,
253
256
  },
254
257
  {
255
258
  "result_package_id": self.delivery_package.id,
256
259
  "shopfloor_checkout_done": True,
260
+ "quantity": 10,
261
+ "qty_picked": 10,
262
+ "picked": True,
257
263
  },
258
264
  # Line 3 has been split
259
265
  {
260
266
  "result_package_id": self.delivery_package.id,
261
267
  "shopfloor_checkout_done": True,
262
- "product_uom_qty": 3,
263
- "qty_done": 3,
268
+ "quantity": 3,
269
+ "qty_picked": 3,
270
+ "picked": True,
264
271
  },
265
272
  ],
266
273
  )
267
274
  # Left quantity to do from line 3
268
275
  new_move_line = self.picking.move_line_ids.filtered(
269
- lambda line: line.qty_done == 0 and line.quantity == 7
276
+ lambda line: not line.picked and line.quantity == 7
270
277
  )
271
278
  self.assertTrue(new_move_line)
272
279
  self.assertFalse(new_move_line.shopfloor_checkout_done)
@@ -313,12 +320,12 @@ class CheckoutScanSetDestPackageCase(CheckoutCommonCase, SelectDestPackageMixin)
313
320
  message=self.service.msg_store.dest_package_not_valid(package),
314
321
  )
315
322
 
316
- def test_set_dest_package_error_qty_done_above(self):
317
- # If the qty_done of a selected line goes beyond
323
+ def test_set_dest_package_error_qty_picked_above(self):
324
+ # If the picked qty of a selected line goes beyond
318
325
  # the maximum allowed, a message should be displayed
319
326
  # and the user shouldn't be allowed to select a package.
320
327
  line = fields.first(self.picking.move_line_ids)
321
- line.qty_done = line.quantity + 1
328
+ line.qty_picked = line.quantity + 1
322
329
  response = self.service.dispatch(
323
330
  "list_dest_package",
324
331
  params={
@@ -28,9 +28,9 @@ 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.quantity
32
- move_line2.qty_done = move_line2.quantity
33
- move_line3.qty_done = 0
31
+ move_line1.qty_picked = move_line1.quantity
32
+ move_line2.qty_picked = move_line2.quantity
33
+ move_line3.qty_picked = 0
34
34
 
35
35
  response = self.service.dispatch(
36
36
  "new_package",
@@ -50,7 +50,7 @@ class CheckoutNewPackageCase(CheckoutCommonCase, CheckoutSelectPackageMixin):
50
50
  )
51
51
  self.assertRecordValues(
52
52
  move_line3,
53
- # qty_done was zero so we don't set it as packed and it remains in
53
+ # picked qty was zero so we don't set it as packed and it remains in
54
54
  # the same package
55
55
  [{"result_package_id": pack1.id, "shopfloor_checkout_done": False}],
56
56
  )
@@ -62,7 +62,7 @@ class CheckoutNewPackageCase(CheckoutCommonCase, CheckoutSelectPackageMixin):
62
62
  message=self.msg_store.goods_packed_in(new_package),
63
63
  )
64
64
 
65
- def test_set_dest_package_error_qty_done_above(self):
65
+ def test_set_dest_package_error_qty_picked_above(self):
66
66
  picking = self._create_picking(
67
67
  lines=[
68
68
  (self.product_a, 10),
@@ -72,12 +72,12 @@ class CheckoutNewPackageCase(CheckoutCommonCase, CheckoutSelectPackageMixin):
72
72
  moves = picking.move_ids
73
73
  self._fill_stock_for_moves(moves, in_package=True)
74
74
  picking.action_assign()
75
- # If the qty_done of a selected line goes beyond
75
+ # If the picked qty of a selected line goes beyond
76
76
  # the maximum allowed, a message should be displayed
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.quantity + 1
80
+ line.qty_picked = line.quantity + 1
81
81
  response = self.service.dispatch(
82
82
  "list_dest_package",
83
83
  params={
@@ -33,9 +33,9 @@ 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.quantity
37
- move_line2.qty_done = move_line2.quantity
38
- move_line3.qty_done = 0
36
+ move_line1.qty_picked = move_line1.quantity
37
+ move_line2.qty_picked = move_line2.quantity
38
+ move_line3.qty_picked = 0
39
39
  response = self.service.dispatch(
40
40
  "no_package",
41
41
  params={
@@ -79,12 +79,12 @@ class CheckoutNoPackageCase(CheckoutCommonCase, CheckoutSelectPackageMixin):
79
79
  )
80
80
  self.assertEqual(repr(err), "`checkout.no_package` endpoint is not enabled")
81
81
 
82
- def test_set_dest_package_error_qty_done_above(self):
83
- # If the qty_done of a selected line goes beyond
82
+ def test_set_dest_package_error_qty_picked_above(self):
83
+ # If the picked qty of a selected line goes beyond
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.quantity + 1
87
+ line.qty_picked = line.quantity + 1
88
88
  response = self.service.dispatch(
89
89
  "list_dest_package",
90
90
  params={
@@ -189,7 +189,7 @@ class CheckoutScanCase(CheckoutCommonCase):
189
189
  "select_line",
190
190
  params={"picking_id": picking.id, "package_id": package.id},
191
191
  )
192
- self.assertTrue(all(m.qty_done for m in picking.move_line_ids))
192
+ self.assertTrue(all(m.qty_picked for m in picking.move_line_ids))
193
193
  self.assertEqual(picking.move_line_ids.shopfloor_user_id, self.env.user)
194
194
  # He restarts the scenario and try to select again the previous line
195
195
  # to continue its job
@@ -17,8 +17,8 @@ class CheckoutSelectChildLocationCase(CheckoutCommonCase):
17
17
  picking.action_assign()
18
18
  cls.line1 = picking.move_line_ids[0]
19
19
  cls.line2 = picking.move_line_ids[1]
20
- cls.line1.write({"qty_done": 10, "shopfloor_checkout_done": True})
21
- cls.line2.write({"qty_done": 2, "shopfloor_checkout_done": True})
20
+ cls.line1.write({"qty_picked": 10, "shopfloor_checkout_done": True})
21
+ cls.line2.write({"qty_picked": 2, "shopfloor_checkout_done": True})
22
22
 
23
23
  cls.dest_location = picking.location_dest_id
24
24
  cls.child_location = (
@@ -382,7 +382,9 @@ class CheckoutScanLineCase(CheckoutScanLineCaseBase):
382
382
  self._fill_stock_for_moves(picking.move_ids, in_package=True)
383
383
  picking.action_assign()
384
384
  # set all lines as done
385
- picking.move_line_ids.write({"qty_done": 10.0, "shopfloor_checkout_done": True})
385
+ picking.move_line_ids.write(
386
+ {"qty_picked": 10.0, "shopfloor_checkout_done": True}
387
+ )
386
388
  response = self.service.dispatch(
387
389
  "scan_line",
388
390
  params={
@@ -21,7 +21,7 @@ class CheckoutScanPackageActionCase(CheckoutCommonCase, CheckoutSelectPackageMix
21
21
 
22
22
  # we have selected the pack that contains product a
23
23
  line_a = picking.move_line_ids[0]
24
- line_a.qty_done = origin_qty_func(line_a)
24
+ line_a.qty_picked = origin_qty_func(line_a)
25
25
 
26
26
  response = self.service.dispatch(
27
27
  "scan_package_action",
@@ -33,7 +33,7 @@ class CheckoutScanPackageActionCase(CheckoutCommonCase, CheckoutSelectPackageMix
33
33
  )
34
34
 
35
35
  # since we scanned the barcode of the product and we had a
36
- # qty_done, the qty_done should flip to 0
36
+ # picked qty, the picked qty should flip to 0
37
37
  self._assert_selected_qties(
38
38
  response, line_a, {line_a: expected_qty_func(line_a)}
39
39
  )
@@ -86,7 +86,7 @@ class CheckoutScanPackageActionCase(CheckoutCommonCase, CheckoutSelectPackageMix
86
86
  self._fill_stock_for_moves(picking.move_ids, in_package=True)
87
87
  picking.action_assign()
88
88
  move_line = picking.move_line_ids
89
- origin_qty_done = move_line.qty_done
89
+ origin_qty_picked = move_line.qty_picked
90
90
  response = self.service.dispatch(
91
91
  "scan_package_action",
92
92
  params={
@@ -99,7 +99,7 @@ class CheckoutScanPackageActionCase(CheckoutCommonCase, CheckoutSelectPackageMix
99
99
  response,
100
100
  move_line,
101
101
  # no change as the scan was not valid
102
- {move_line: origin_qty_done},
102
+ {move_line: origin_qty_picked},
103
103
  message={
104
104
  "message_type": "warning",
105
105
  "body": "Product tracked by lot, please scan one.",
@@ -135,9 +135,9 @@ 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.quantity
139
- move_line2.qty_done = move_line2.quantity
140
- move_line3.qty_done = 0
138
+ move_line1.qty_picked = move_line1.quantity
139
+ move_line2.qty_picked = move_line2.quantity
140
+ move_line3.qty_picked = 0
141
141
 
142
142
  response = self.service.dispatch(
143
143
  "scan_package_action",
@@ -161,7 +161,7 @@ class CheckoutScanPackageActionCase(CheckoutCommonCase, CheckoutSelectPackageMix
161
161
  )
162
162
  self.assertRecordValues(
163
163
  move_line3,
164
- # qty_done was zero so it hasn't been done anyway
164
+ # picked qty was zero so it hasn't been done anyway
165
165
  [{"result_package_id": pack1.id, "shopfloor_checkout_done": False}],
166
166
  )
167
167
  self.assert_response(
@@ -243,7 +243,7 @@ class CheckoutScanPackageActionCase(CheckoutCommonCase, CheckoutSelectPackageMix
243
243
 
244
244
  selected_lines = pack1_moves.move_line_ids
245
245
  # they are all selected
246
- selected_lines.write({"qty_done": 10.0})
246
+ selected_lines.write({"qty_picked": 10.0})
247
247
 
248
248
  response = self.service.dispatch(
249
249
  "scan_package_action",
@@ -296,9 +296,9 @@ 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.quantity
300
- move_line2.qty_done = move_line2.quantity
301
- move_line3.qty_done = 0
299
+ move_line1.qty_picked = move_line1.quantity
300
+ move_line2.qty_picked = move_line2.quantity
301
+ move_line3.qty_picked = 0
302
302
 
303
303
  packaging = (
304
304
  self.env["stock.package.type"]
@@ -349,7 +349,7 @@ class CheckoutScanPackageActionCase(CheckoutCommonCase, CheckoutSelectPackageMix
349
349
  )
350
350
  self.assertRecordValues(
351
351
  move_line3,
352
- # qty_done was zero so we don't set it as packed and it remains in
352
+ # picked qty was zero so we don't set it as packed and it remains in
353
353
  # the same package
354
354
  [{"result_package_id": pack1.id, "shopfloor_checkout_done": False}],
355
355
  )
@@ -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.quantity
371
+ selected_lines.qty_picked = selected_lines.quantity
372
372
 
373
373
  packaging = (
374
374
  self.env["stock.package.type"]
@@ -21,7 +21,7 @@ class CheckoutScanPackageActionCaseNoPrefillQty(
21
21
  self._fill_stock_for_moves(picking.move_ids, in_package=False)
22
22
  picking.action_assign()
23
23
  move_line = picking.move_line_ids
24
- origin_qty_done = move_line.qty_done = 2
24
+ origin_qty_picked = move_line.qty_picked = 2
25
25
  response = self.service.dispatch(
26
26
  "scan_package_action",
27
27
  params={
@@ -33,7 +33,7 @@ class CheckoutScanPackageActionCaseNoPrefillQty(
33
33
  self._assert_selected_qties(
34
34
  response,
35
35
  move_line,
36
- {move_line: origin_qty_done + 1},
36
+ {move_line: origin_qty_picked + 1},
37
37
  )
38
38
 
39
39
  def test_scan_package_action_scan_product2_to_increment_qty(self):
@@ -68,7 +68,7 @@ class CheckoutScanPackageActionCaseNoPrefillQty(
68
68
 
69
69
  # First line is fully processed,
70
70
  # so we expect the second line to be incremented.
71
- move_lines[0].qty_done = 3.0
71
+ move_lines[0].qty_picked = 3.0
72
72
  self.service.dispatch(
73
73
  "scan_package_action",
74
74
  params={
@@ -77,8 +77,8 @@ class CheckoutScanPackageActionCaseNoPrefillQty(
77
77
  "barcode": self.product_a.barcode,
78
78
  },
79
79
  )
80
- self.assertEqual(move_lines[0].qty_done, 3.0)
81
- self.assertEqual(move_lines[1].qty_done, 1.0)
80
+ self.assertEqual(move_lines[0].qty_picked, 3.0)
81
+ self.assertEqual(move_lines[1].qty_picked, 1.0)
82
82
 
83
83
  def test_scan_package_action_scan_lot_to_increment_qty(self):
84
84
  """ """
@@ -86,7 +86,7 @@ class CheckoutScanPackageActionCaseNoPrefillQty(
86
86
  self._fill_stock_for_moves(picking.move_ids, in_lot=True)
87
87
  picking.action_assign()
88
88
  move_line = picking.move_line_ids
89
- origin_qty_done = move_line.qty_done = 2
89
+ origin_qty_picked = move_line.qty_picked = 2
90
90
  response = self.service.dispatch(
91
91
  "scan_package_action",
92
92
  params={
@@ -98,7 +98,7 @@ class CheckoutScanPackageActionCaseNoPrefillQty(
98
98
  self._assert_selected_qties(
99
99
  response,
100
100
  move_line,
101
- {move_line: origin_qty_done + 1},
101
+ {move_line: origin_qty_picked + 1},
102
102
  )
103
103
 
104
104
  def test_scan_package_action_scan_packaging_to_increment_qty(self):
@@ -107,7 +107,7 @@ class CheckoutScanPackageActionCaseNoPrefillQty(
107
107
  self._fill_stock_for_moves(picking.move_ids, in_package=True, in_lot=False)
108
108
  picking.action_assign()
109
109
  move_line = picking.move_line_ids
110
- origin_qty_done = move_line.qty_done = 0
110
+ origin_qty_picked = move_line.qty_picked = 0
111
111
  response = self.service.dispatch(
112
112
  "scan_package_action",
113
113
  params={
@@ -119,5 +119,5 @@ class CheckoutScanPackageActionCaseNoPrefillQty(
119
119
  self._assert_selected_qties(
120
120
  response,
121
121
  move_line,
122
- {move_line: origin_qty_done + self.product_a_packaging.qty},
122
+ {move_line: origin_qty_picked + self.product_a_packaging.qty},
123
123
  )
@@ -109,7 +109,7 @@ class CheckoutSelectLineCase(CheckoutCommonCase, CheckoutSelectPackageMixin):
109
109
  def test_select_line_all_lines_done(self):
110
110
  # set all lines as done
111
111
  self.picking.move_line_ids.write(
112
- {"qty_done": 10.0, "shopfloor_checkout_done": True}
112
+ {"qty_picked": 10.0, "shopfloor_checkout_done": True}
113
113
  )
114
114
  response = self.service.dispatch(
115
115
  "select_line",
@@ -42,9 +42,11 @@ class CheckoutSelectPackageMixin:
42
42
  sorted(selected_lines.ids), sorted([line.id for line in lines_quantities])
43
43
  )
44
44
  for line, quantity in lines_quantities.items():
45
- self.assertEqual(line.qty_done, quantity)
45
+ self.assertEqual(line.qty_picked, quantity)
46
46
  for line in deselected_lines:
47
- self.assertEqual(line.qty_done, 0, "Lines deselected must have no qty done")
47
+ self.assertEqual(
48
+ line.qty_picked, 0, "Lines deselected must have no qty done"
49
+ )
48
50
  self._assert_selected_response(
49
51
  response, selected_lines, message=message, packing_info=packing_info
50
52
  )
@@ -57,11 +59,11 @@ class CheckoutSelectPackageMixin:
57
59
  unselected_lines = picking.move_line_ids - selected_lines
58
60
  for line in selected_lines - related_lines:
59
61
  self.assertEqual(
60
- line.qty_done,
62
+ line.qty_picked,
61
63
  line.quantity,
62
64
  "Scanned lines must have their qty done set to the reserved quantity",
63
65
  )
64
66
  for line in unselected_lines + related_lines:
65
- self.assertEqual(line.qty_done, 0)
67
+ self.assertEqual(line.qty_picked, 0)
66
68
  package_lines = selected_lines + related_lines
67
69
  self._assert_selected_response(response, package_lines, message=message, **kw)
@@ -24,15 +24,15 @@ class CheckoutSetQtyCommonCase(CheckoutCommonCase, CheckoutSelectPackageMixin):
24
24
  def setUp(self):
25
25
  super().setUp()
26
26
  # we assume we have called /select_line on pack one, so by default, we
27
- # expect the lines for product a and b to have their qty_done set to
27
+ # expect the lines for product a and b to have their picked qty set to
28
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.quantity for line in self.selected_lines)
33
+ all(line.qty_picked == line.quantity for line in self.selected_lines)
34
34
  )
35
- self.assertTrue(all(line.qty_done == 0 for line in self.deselected_lines))
35
+ self.assertTrue(all(not line.picked for line in self.deselected_lines))
36
36
 
37
37
 
38
38
  class CheckoutResetLineQtyCase(CheckoutSetQtyCommonCase):
@@ -83,7 +83,7 @@ class CheckoutSetLineQtyCase(CheckoutSetQtyCommonCase):
83
83
  def test_set_line_qty_ok(self):
84
84
  selected_lines = self.moves_pack1.move_line_ids
85
85
  # do as if the user removed the qties of the 2 selected lines
86
- selected_lines.qty_done = 0
86
+ selected_lines.qty_picked = 0
87
87
  line_to_set = selected_lines[0]
88
88
  line_no_qty = selected_lines[1]
89
89
  # we want to check that when we give the package id, we get
@@ -96,8 +96,9 @@ 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.quantity)
100
- self.assertEqual(line_no_qty.qty_done, 0)
99
+ self.assertEqual(line_to_set.qty_picked, line_to_set.quantity)
100
+ self.assertEqual(line_no_qty.qty_picked, 0)
101
+ self.assertFalse(line_no_qty.picked)
101
102
  self._assert_selected_qties(
102
103
  response,
103
104
  selected_lines,
@@ -145,8 +146,8 @@ class CheckoutSetCustomQtyCase(CheckoutSetQtyCommonCase):
145
146
  "qty_done": new_qty,
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.quantity)
149
+ self.assertEqual(line_to_change.qty_picked, new_qty)
150
+ self.assertEqual(line_keep_qty.qty_picked, line_keep_qty.quantity)
150
151
  self._assert_selected_qties(
151
152
  response,
152
153
  selected_lines,
@@ -180,7 +181,7 @@ class CheckoutSetCustomQtyCase(CheckoutSetQtyCommonCase):
180
181
  selected_lines = self.moves_pack1.move_line_ids
181
182
  line1 = selected_lines[0]
182
183
  # modify so we can check that a too high quantity set the max
183
- line1.qty_done = 1
184
+ line1.qty_picked = 1
184
185
  line2 = selected_lines[1]
185
186
  response = self.service.dispatch(
186
187
  "set_custom_qty",
@@ -240,8 +241,8 @@ class CheckoutSetCustomQtyCase(CheckoutSetQtyCommonCase):
240
241
  "qty_done": new_qty,
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.quantity)
244
+ self.assertEqual(line_to_change.qty_picked, new_qty)
245
+ self.assertEqual(line_keep_qty.qty_picked, line_keep_qty.quantity)
245
246
  new_lines = [
246
247
  x for x in self.moves_pack1.move_line_ids if x not in selected_lines
247
248
  ]
@@ -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.quantity
38
+ ml.picked = True
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.quantity
57
+ ml.picked = True
58
58
  ml.shopfloor_checkout_done = True
59
59
  response = self.service.dispatch(
60
60
  "summary", params={"picking_id": self.picking.id}