From 26d7a905896fe8ca6620ecce26d957947960ae38 Mon Sep 17 00:00:00 2001 From: Juanjo Garcia Date: Fri, 16 Oct 2020 14:32:53 +0200 Subject: [PATCH] Ensure that get_cost_price is always a decimal. 041293 --- plan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plan.py b/plan.py index b148238..18ed79f 100644 --- a/plan.py +++ b/plan.py @@ -193,7 +193,7 @@ class Plan(ModelSQL, ModelView): return self.product.cost_price if self.product else None def get_cost_price(self, name): - return sum(c.cost for c in self.costs if c.cost) + return Decimal(sum(c.cost for c in self.costs if c.cost)) @classmethod def clean(cls, plans):