From 0487ad5515df3fd1535bd5d1271e69e842d186e4 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 19 Aug 2019 16:40:29 +0530 Subject: [PATCH] fix: Code cleanup --- erpnext/controllers/sales_and_purchase_return.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py index e9633558ef..6054b9015a 100644 --- a/erpnext/controllers/sales_and_purchase_return.py +++ b/erpnext/controllers/sales_and_purchase_return.py @@ -24,10 +24,7 @@ def validate_return_against(doc): else: ref_doc = frappe.get_doc(doc.doctype, doc.return_against) - if doc.doctype in ("Sales Invoice", "Delivery Note"): - party_type = "customer" - else: - party_type = "supplier" + party_type == "customer" if doc.doctype in ("Sales Invoice", "Delivery Note") else "supplier" if ref_doc.company == doc.company and ref_doc.get(pary_type) == doc.get(party_type) and ref_doc.docstatus == 1: # validate posting date time