fix:add exception for no opportunity

This commit is contained in:
Pranav Nachanekar 2019-10-04 16:32:32 +05:30
parent 911e034d1c
commit e18388ade3

View File

@ -142,6 +142,8 @@ class Appointment(Document):
'party_name': self.lead,
},
order_by='creation desc')
if not opporutnities:
return None
latest_opportunity = frappe.get_doc(
'Opportunity', opporutnities[0].name)
assignee = latest_opportunity._assign