From 4701bc8bfcf73889a72086ca3b20ad7f89e29afc Mon Sep 17 00:00:00 2001 From: 0Pranav Date: Fri, 1 Nov 2019 09:36:29 +0530 Subject: [PATCH] Add ignore permissions for opportunity --- erpnext/crm/doctype/appointment/appointment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/crm/doctype/appointment/appointment.py b/erpnext/crm/doctype/appointment/appointment.py index 18f47c9be0..bc2c838930 100644 --- a/erpnext/crm/doctype/appointment/appointment.py +++ b/erpnext/crm/doctype/appointment/appointment.py @@ -140,11 +140,11 @@ class Appointment(Document): filters={ 'party_name': self.lead, }, + ignore_permissions=True, order_by='creation desc') if not opporutnities: return None - latest_opportunity = frappe.get_doc( - 'Opportunity', opporutnities[0].name) + latest_opportunity = frappe.get_doc('Opportunity', opporutnities[0].name ) assignee = latest_opportunity._assign if not assignee: return None