mirror of
https://bitbucket.org/presik/trytonpsk-production_accounting.git
synced 2023-12-14 05:22:54 +01:00
Fix
This commit is contained in:
parent
140d6c12cd
commit
fab2aff30a
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue