Allow to cancel all shipments. Split shipment and origin checking.

This commit refs #4594
This commit is contained in:
Sergio Morillo 2018-05-11 21:26:29 +02:00
parent 472d411134
commit c2a029cb75
1 changed files with 2 additions and 1 deletions

View File

@ -286,7 +286,8 @@ class LoadOrder:
if m.unit_load in _groupitems]
load_moves += [m for m in self.outgoing_moves
if m.unit_load in _groupitems]
with Transaction().set_context(check_origin=False):
with Transaction().set_context(check_origin=False,
check_shipment=False):
Move.cancel(shipment_moves + load_moves)
Move.delete(shipment_moves + load_moves)
if sale_line and not sale_line.quantity: