FIX balance_consumption operation in case total product != 0.

#163746
This commit is contained in:
Raimon Esteve 2023-11-30 18:28:30 +01:00
parent ea0da05761
commit 6d1b86ef5c
1 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ class Production(metaclass=PoolMeta):
if direction == 'backward':
balance_quantity = quantity
# balance_consumption = qty
balance_consumption = (qty * quantity) / total_product
balance_consumption = ((qty * quantity) / total_product) if total_product != 0. else 0
balance_plan_consumption = balance_difference = balance_difference_percent = 0.0
if self.bom:
@ -89,7 +89,7 @@ class Production(metaclass=PoolMeta):
else:
balance_quantity = qty
# balance_consumption = quantity
balance_consumption = (qty * quantity) / total_product
balance_consumption = ((qty * quantity) / total_product) if total_product != 0. else 0
balance_plan_consumption = balance_difference = balance_difference_percent = 0.0
if self.bom: