@@ -8,7 +8,10 @@ def setUp(self):
8
8
super ().setUp ()
9
9
10
10
self .maintenance_warehouse = self .env ["stock.warehouse" ].create (
11
- {"name" : "Test warehouse" , "code" : "TEST" ,}
11
+ {
12
+ "name" : "Test warehouse" ,
13
+ "code" : "TEST" ,
14
+ }
12
15
)
13
16
14
17
self .product1 = self .env ["product.product" ].create (
@@ -107,12 +110,15 @@ def test_picking(self):
107
110
self .assertEqual (len (self .equipment_1 .stock_picking_ids ), 0 )
108
111
109
112
qty_done = 5.0
113
+ location_id = self .maintenance_warehouse .lot_stock_id .id
114
+ location_dest_id = self .maintenance_warehouse .wh_cons_loc_id .id
115
+ picking_type_id = self .maintenance_warehouse .cons_type_id .id
110
116
picking = self .env ["stock.picking" ].create (
111
117
{
112
118
"maintenance_request_id" : self .request_1 .id ,
113
- "picking_type_id" : self . maintenance_warehouse . cons_type_id . id ,
114
- "location_id" : self . maintenance_warehouse . lot_stock_id . id ,
115
- "location_dest_id" : self . maintenance_warehouse . wh_cons_loc_id . id ,
119
+ "picking_type_id" : picking_type_id ,
120
+ "location_id" : location_id ,
121
+ "location_dest_id" : location_dest_id ,
116
122
"move_lines" : [
117
123
(
118
124
0 ,
@@ -122,9 +128,9 @@ def test_picking(self):
122
128
"product_id" : self .product1 .id ,
123
129
"product_uom" : self .env .ref ("uom.product_uom_unit" ).id ,
124
130
"product_uom_qty" : 5.0 ,
125
- "picking_type_id" : self . maintenance_warehouse . cons_type_id . id ,
126
- "location_id" : self . maintenance_warehouse . lot_stock_id . id ,
127
- "location_dest_id" : self . maintenance_warehouse . wh_cons_loc_id . id ,
131
+ "picking_type_id" : picking_type_id ,
132
+ "location_id" : location_id ,
133
+ "location_dest_id" : location_dest_id ,
128
134
"move_line_ids" : [
129
135
(
130
136
0 ,
@@ -135,8 +141,8 @@ def test_picking(self):
135
141
"uom.product_uom_unit"
136
142
).id ,
137
143
"qty_done" : qty_done ,
138
- "location_id" : self . maintenance_warehouse . lot_stock_id . id ,
139
- "location_dest_id" : self . maintenance_warehouse . wh_cons_loc_id . id ,
144
+ "location_id" : location_id ,
145
+ "location_dest_id" : location_dest_id ,
140
146
},
141
147
)
142
148
],
0 commit comments