bug th qt
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user