This commit is contained in:
oscar alvarez 2022-02-24 15:06:52 -05:00
parent 140d6c12cd
commit fab2aff30a

View file

@ -17,6 +17,8 @@ ZERO = Decimal(0)
def round_dec(number):
if not isinstance(Decimal, number):
number = Decimal(number)
return Decimal(number.quantize(Decimal('.01')))
@ -192,7 +194,7 @@ class Production(metaclass=PoolMeta):
cls.set_analytic_lines(line_, date_, analytic)
lines.append(line_)
values = {'material_costs': Decimal(round(sum(material_costs), 2))}
values = {'material_costs': round_dec(material_costs)}
return lines, values
@classmethod