fix: removed unused lines

This commit is contained in:
Jannat Patel
2021-10-20 11:36:00 +05:30
committed by GitHub
parent 873d166a4e
commit 698214bd59

View File

@@ -42,9 +42,6 @@ class Opportunity(TransactionBase):
if not self.with_items:
self.items = []
else:
self.calculate_totals()
def map_fields(self):
for field in self.meta.fields:
if not self.get(field.fieldname):
@@ -54,20 +51,6 @@ class Opportunity(TransactionBase):
except Exception:
continue
def calculate_totals(self):
total = base_total = 0
for item in self.get('items'):
item.amount = flt(item.rate) * flt(item.qty)
item.base_rate = flt(self.conversion_rate * item.rate)
item.base_amount = flt(self.conversion_rate * item.amount)
total += item.amount
base_total += item.base_amount
self.total = flt(total)
self.base_total = flt(base_total)
self.grand_total = flt(self.total) + flt(self.opportunity_amount)
self.base_grand_total = flt(self.base_total) + flt(self.base_opportunity_amount)
def make_new_lead_if_required(self):
"""Set lead against new opportunity"""
if (not self.get("party_name")) and self.contact_email: