Skip to content

Commit 57f8c4b

Browse files
update
1 parent 04a8a65 commit 57f8c4b

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

delivery_send_to_shipper_at_operation/models/stock_picking.py

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def _handle_send_to_shipper_at_operation(self):
5252
self.with_context(skip_delivery_cost=True).send_to_shipper()
5353
# Flag the current operation and the ship one.
5454
# Mandatory to not execute twice 'send_to_shipper' method
55-
self.delivery_notification_sent = True
5655
related_ship.delivery_notification_sent = True
5756
related_ship.carrier_price = self.carrier_price
5857
if not related_ship.carrier_tracking_ref:

delivery_send_to_shipper_at_operation/tests/test_send_to_shipper.py

+24
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,30 @@ def test_picking_fields_view_get(self):
206206
attrs = safe_eval(attrs_str)
207207
self.assertIn(("delivery_notification_sent", "=", True), attrs["invisible"])
208208

209+
def test_send_to_shipper_on_partial_pack(self):
210+
"""Check if a backorder of a transfer, where the delivery notification is already sent
211+
keeps the delivery notification sent set.
212+
"""
213+
with mock.patch.object(
214+
type(self.carrier_on_pack),
215+
"send_shipping",
216+
return_value=SEND_SHIPPING_RETURN_VALUE,
217+
):
218+
self.shipping.carrier_id = self.carrier_on_pack
219+
self._validate_picking(self.picking)
220+
pack_backorder = self._validate_picking(self.packing, 5)
221+
self.assertTrue(self.shipping.delivery_notification_sent)
222+
self.assertFalse(pack_backorder.delivery_notification_sent)
223+
self._validate_picking(pack_backorder, 5)
224+
self.assertTrue(self.shipping.delivery_notification_sent)
225+
backorder = self._validate_picking(self.shipping, 5)
226+
self.assertEqual(self.shipping.state, "done")
227+
self.assertTrue(self.shipping.delivery_notification_sent)
228+
self.assertTrue(backorder.delivery_notification_sent)
229+
backorder2 = self._validate_picking(backorder, 5)
230+
self.assertFalse(backorder2)
231+
self.assertTrue(backorder.delivery_notification_sent)
232+
209233
def test_send_to_shipper_on_pack_partial_shipping(self):
210234
"""Check if a backorder of a transfer, where the delivery notification is already sent
211235
keeps the delivery notification sent set.

0 commit comments

Comments
 (0)