bug th qt

This commit is contained in:
2026-04-09 20:23:09 +02:00
parent a1ab7dec82
commit 8b9787d4c0
3 changed files with 40 additions and 8 deletions

View File

@@ -103,10 +103,14 @@ class Component(metaclass=PoolMeta):
if self.sale_line:
return self.sale_line.unit
def get_quota_sale(self, name):
if self.sale_line:
if self.sale_line.quantity:
return round(self.sale_line.quantity_theorical / (self.nbdays if self.nbdays > 0 else 1),4)
def get_quota_sale(self, name):
if self.sale_line:
quantity = getattr(self.sale_line, 'quantity_theorical', None)
if quantity is None:
quantity = getattr(self.sale_line, 'quantity', None)
if quantity is not None:
nbdays = self.nbdays if self.nbdays and self.nbdays > 0 else 1
return round(Decimal(quantity) / nbdays, 4)
class Pricing(metaclass=PoolMeta):
"Pricing"