minor fix

This commit is contained in:
wilsongomez 2022-09-12 17:58:50 -05:00
parent 4eaf0e8b85
commit 8dcd0c885e
1 changed files with 5 additions and 4 deletions

View File

@ -92,10 +92,11 @@ class Production(metaclass=PoolMeta):
def get_perfomance(self, name=None):
res = Decimal(0)
origin = sum(p.quantity for p in self.bom.outputs ) * self.quantity
result = sum(p.quantity for p in self.outputs)
if result != 0 and origin != 0:
res = Decimal(str(round(result*100/origin, 2)))
if self.bom:
origin = sum(p.quantity for p in self.bom.outputs ) * self.quantity
result = sum(p.quantity for p in self.outputs)
if result != 0 and origin != 0:
res = Decimal(str(round(result*100/origin, 2)))
return res
def update_product_cost(self, product):