Dont add the cancelled moves. (#1)

Task #052927
This commit is contained in:
Juanjo Garcia 2022-05-18 16:37:31 +02:00
parent a97e89ad60
commit 38d28aa5b9
1 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,8 @@ class Production(metaclass=PoolMeta):
digits = self.on_change_with_unit_digits()
quantity = 0.0
for move in getattr(self, 'outputs' if direction == 'backward' else 'inputs'):
if move.state == 'cancelled':
continue
if move.product == requested_product:
# skip moves that same product but different lot
if lot and lot != move.lot:
@ -35,6 +37,8 @@ class Production(metaclass=PoolMeta):
moves = {}
for move in getattr(self, 'inputs' if direction == 'backward' else 'outputs'):
if move.state == 'cancelled':
continue
product = move.product
mqty = Uom.compute_qty(
move.uom, move.quantity, move.product.default_uom, False)