From 2eeef817f3cd02729310ec7e83c7f22f07e8e01f Mon Sep 17 00:00:00 2001 From: Guillem Barba Date: Thu, 5 Mar 2015 13:03:11 +0100 Subject: [PATCH] Return production's cost rounded to field's precision issue4610 review14061002 --- production.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/production.py b/production.py index ab7b76e0d8..52c00f5c74 100644 --- a/production.py +++ b/production.py @@ -340,7 +340,9 @@ class Production(Workflow, ModelSQL, ModelView): else: cost_price = input_.product.cost_price cost += (Decimal(str(input_.internal_quantity)) * cost_price) - return cost + + digits = self.__class__.cost.digits + return cost.quantize(Decimal(str(10 ** -digits[1]))) @fields.depends('inputs') def on_change_with_cost(self):