Dont add the cancelled moves. (#1)

Task #052927
This commit is contained in:
juanjo-nan 2022-05-18 16:35:01 +02:00 committed by GitHub
parent b36f301a75
commit 05b3098520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -28,6 +28,9 @@ 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'):
# TODO: In 6.0 or above use 'cancelled'
if move.state == 'cancel':
continue
if move.product == requested_product:
# skip moves that same product but different lot
if lot and lot != move.lot:
@ -36,6 +39,9 @@ class Production(metaclass=PoolMeta):
moves = {}
for move in getattr(self, 'inputs' if direction == 'backward' else 'outputs'):
# TODO: In 6.0 or above use 'cancelled'
if move.state == 'cancel':
continue
product = move.product
mqty = Uom.compute_qty(
move.uom, move.quantity, move.product.default_uom, False)