fix: Rename variables
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index 8d69f7b..79e40f6 100755
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -227,15 +227,15 @@
check_credit_limit(self.customer, self.company)
def check_nextdoc_docstatus(self):
- draft_rv = frappe.db.sql_list("""select distinct t1.name
+ linked_invoices = frappe.db.sql_list("""select distinct t1.name
from `tabSales Invoice` t1,`tabSales Invoice Item` t2
where t1.name = t2.parent and t2.sales_order = %s and t1.docstatus = 0""",
self.name)
- if draft_rv:
- draft_rv = [get_link_to_form("Sales Invoice", si) for si in draft_rv]
+ if linked_invoices:
+ linked_invoices = [get_link_to_form("Sales Invoice", si) for si in linked_invoices]
frappe.throw(_("Sales Invoice {0} must be deleted before cancelling this Sales Order")
- .format(", ".join(draft_rv)))
+ .format(", ".join(linked_invoices)))
def check_modified_date(self):
mod_db = frappe.db.get_value("Sales Order", self.name, "modified")