@@ -28,6 +28,8 @@ def setUp(self, *args, **kwargs):
28
28
"geodis_fr_customer_id" : "787000" ,
29
29
}
30
30
)
31
+ carrier = self .env .ref ("delivery_roulier_geodis_fr.delivery_carrier_mes" )
32
+ carrier .carrier_account_id = self .account .id
31
33
self .agency = self .env ["delivery.carrier.agency" ].create (
32
34
{
33
35
"name" : "Lille Agency" ,
@@ -61,6 +63,13 @@ def _get_vcr_kwargs(self, **kwargs):
61
63
"before_record_request" : self ._hide_sensitive_data ,
62
64
}
63
65
66
+ def _transfer_order_picking (self ):
67
+ for move in self .picking .move_ids :
68
+ move .quantity_done = move .product_uom_qty
69
+ move_lines = self .picking .move_line_ids
70
+ self .picking ._put_in_pack (move_lines )
71
+ return super ()._transfer_order_picking ()
72
+
64
73
def _product_data (self ):
65
74
data = super ()._product_data ()
66
75
data .update (
@@ -88,27 +97,23 @@ def _partner_data(self):
88
97
)
89
98
return data
90
99
91
- def test_labels (self ):
100
+ def test_labels_and_edi (self ):
92
101
res = super ().test_labels ()
93
102
self .assertTrue (self .picking .geodis_shippingid )
94
- return res
95
-
96
- def test_edi (self ):
97
103
deposit = self .env ["deposit.slip" ].create (
98
104
{
99
105
"name" : "test" ,
100
106
"delivery_type" : "geodis_fr" ,
101
107
"picking_ids" : [(6 , 0 , self .picking .ids )],
102
108
}
103
109
)
104
- # filled on label generation / simulate it
105
- self .picking .write ({"geodis_shippingid" : "0123456" })
106
110
deposit .validate_deposit ()
107
111
attachment = self .env ["ir.attachment" ].search (
108
112
[("res_id" , "=" , deposit .id ), ("res_model" , "=" , "deposit.slip" )]
109
113
)
110
114
self .assertEqual (len (attachment ), 1 )
111
115
self .assertTrue (attachment .datas )
116
+ return res
112
117
113
118
def test_addresses (self ):
114
119
addresses = self .picking ._geodis_fr_get_address_proposition ()
0 commit comments