fix: calculate percentage only if sales team exist

This commit is contained in:
Himanshu Warekar
2019-05-03 17:40:31 +05:30
committed by Nabin Hait
parent 163dbdca34
commit 6aab14f9cf

View File

@@ -60,6 +60,7 @@ class Customer(TransactionBase):
if self.loyalty_program == customer.loyalty_program and not self.loyalty_program_tier:
self.loyalty_program_tier = customer.loyalty_program_tier
if self.sales_team:
allocated_percentage = 0
for percentage in self.sales_team:
allocated_percentage += percentage.allocated_percentage