Skip to content

Commit a3fa0a9

Browse files
committed
[MIG] stock_picking_delivery_link: Migration to 18.0
1 parent 8651dbf commit a3fa0a9

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

stock_picking_delivery_link/__manifest__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
{
55
"name": "Stock Picking Delivery Link",
66
"summary": "Adds link to the delivery on all intermediate operations.",
7-
"version": "16.0.1.1.4",
7+
"version": "18.0.1.0.0",
88
"author": "Camptocamp, Odoo Community Association (OCA)",
99
"website": "https://github.com/OCA/delivery-carrier",
1010
"category": "Warehouse Management",
11-
"depends": ["stock", "delivery"],
11+
"depends": ["stock_delivery"],
1212
"data": ["views/stock_picking.xml", "views/stock_picking_type.xml"],
1313
"installable": True,
1414
"license": "AGPL-3",

stock_picking_delivery_link/tests/test_delivery_link.py

+13-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class TestStockPickingDeliveryLink(StockPickingDeliveryLinkCommonCase):
1111
def setUpClass(cls):
1212
super().setUpClass()
1313
cls.product = cls.env["product.product"].create(
14-
{"name": "Test Product", "type": "product"}
14+
{"name": "Test Product", "type": "consu", "is_storable": True}
1515
)
1616
cls.customer_location = cls.env.ref("stock.stock_location_customers")
1717
test_carrier_product = cls.env["product.product"].create(
@@ -159,9 +159,11 @@ def test_put_in_pack_from_pick_with_wizard(self):
159159
# force wizard on pick operation picking_type_id
160160
pick_picking.picking_type_id.set_delivery_package_type_on_put_in_pack = True
161161
pick_picking.action_assign()
162-
pick_picking.move_line_ids.filtered(
162+
pick_line = pick_picking.move_line_ids.filtered(
163163
lambda ml: ml.product_id == self.product
164-
).qty_done = 5.0
164+
)
165+
self.assertEqual(pick_line.quantity, 5)
166+
pick_line.picked = True
165167
pip_action = pick_picking.action_put_in_pack()
166168
# check the action is a dict
167169
self.assertIsInstance(pip_action, dict)
@@ -215,9 +217,11 @@ def test_put_in_pack_from_pick_with_wizard_carrier(self):
215217
# force wizard on pick operation picking_type_id
216218
pick_picking.picking_type_id.set_delivery_package_type_on_put_in_pack = True
217219
pick_picking.action_assign()
218-
pick_picking.move_line_ids.filtered(
220+
pick_line = pick_picking.move_line_ids.filtered(
219221
lambda ml: ml.product_id == self.product
220-
).qty_done = 5.0
222+
)
223+
self.assertEqual(pick_line.quantity, 5)
224+
pick_line.picked = True
221225
pip_action = pick_picking.action_put_in_pack()
222226
# check the action is a dict
223227
self.assertIsInstance(pip_action, dict)
@@ -268,9 +272,11 @@ def test_put_in_pack_from_pick_without_wizard(self):
268272
# set a carrier on shipment picking but do not force wizard on picking type
269273
ship_picking.carrier_id = self.test_carrier
270274
pick_picking.action_assign()
271-
pick_picking.move_line_ids.filtered(
275+
pick_line = pick_picking.move_line_ids.filtered(
272276
lambda ml: ml.product_id == self.product
273-
).qty_done = 5.0
277+
)
278+
self.assertEqual(pick_line.quantity, 5)
279+
pick_line.picked = True
274280
pip_action = pick_picking.action_put_in_pack()
275281
# the action is not a dict so not a wizard
276282
self.assertNotIsInstance(pip_action, dict)

stock_picking_delivery_link/views/stock_picking.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<group
1212
name="ship_data"
1313
string="Delivery Links"
14-
attrs="{'invisible': [('ship_picking_id', '=', False)]}"
14+
invisible="not ship_picking_id"
1515
>
1616
<field name="ship_picking_id" />
1717
<field name="ship_carrier_id" />

test-requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
odoo-test-helper

0 commit comments

Comments
 (0)