Delete stock moves from components when applying amendment
issue11355 review386301002 (grafted from b6a221e5d224b438d1576f80ef9e201e20193321) --HG-- branch : 6.0
This commit is contained in:
1 parent
e24a39310d
commit
e7c97127f2
1 file changed
+7
-3
@@ -152,9 +152,7 @@ class Amendment(Workflow, ModelSQL, ModelView):
|
||||
for invoice_line in line.invoice_lines:
|
||||
if invoice_line.invoice_state == 'draft':
|
||||
invoice_lines.add(invoice_line)
|
||||
for move in line.moves:
|
||||
if move.state == 'draft':
|
||||
moves.add(move)
|
||||
moves.update(cls._stock_moves(line))
|
||||
|
||||
shipments_waiting = [s for s in shipments if s.state == 'waiting']
|
||||
Shipment.draft(shipments) # Clear inventory moves
|
||||
@@ -168,6 +166,12 @@ class Amendment(Workflow, ModelSQL, ModelView):
|
||||
ShipmentReturn.delete(
|
||||
[s for s in shipment_returns if not s.incoming_moves])
|
||||
|
||||
@classmethod
|
||||
def _stock_moves(cls, line):
|
||||
for move in line.moves:
|
||||
if move.state == 'draft':
|
||||
yield move
|
||||
|
||||
|
||||
class AmendmentLine(ModelSQL, ModelView):
|
||||
"Sale Amendment Line"
|
||||
|
||||
Reference in new issue
Block a user