Ensure that get_cost_price is always a decimal.

041293
This commit is contained in:
Juanjo Garcia 2020-10-16 14:32:53 +02:00
parent d08fc3a2dc
commit 26d7a90589
1 changed files with 1 additions and 1 deletions

View File

@ -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):