From bd2e7c0e53bf8326fd48c8d1ba0794f6c13a9a82 Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Mon, 12 Aug 2019 16:32:14 +0530 Subject: [PATCH] fix: Comment description --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 3e1bd62ee9c..da7b42df776 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -756,13 +756,13 @@ def get_party_details(company, party_type, party, date, cost_center=None): def get_account_details(account, date, cost_center=None): frappe.has_permission('Payment Entry', throw=True) - # to check if passed account is accessible under Payment Entry - # There might be user permissions which can only allow account under certain doctypes - # except Payment Entry + # to check if the passed account is accessible if the reference doctype is Payment Entry account_list = frappe.get_list('Account', { 'name': account }, reference_doctype='Payment Entry', limit=1) - + + # There might be some user permissions which will allow account under certain doctypes + # except for Payment Entry, only in such case we should throw permission error if not account_list: frappe.throw(_('Account: {0} is not permitted under Payment Entry').format(account))