Remove sales invoice from serial number while making sales return entery using delivery note
diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py
index 8420c9b..fe158c9 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.py
+++ b/erpnext/stock/doctype/serial_no/serial_no.py
@@ -85,6 +85,10 @@
self.supplier, self.supplier_name = \
frappe.db.get_value("Purchase Receipt", purchase_sle.voucher_no,
["supplier", "supplier_name"])
+
+ # If sales return entry
+ if self.purchase_document_type == 'Delivery Note':
+ self.sales_invoice = None
else:
for fieldname in ("purchase_document_type", "purchase_document_no",
"purchase_date", "purchase_time", "purchase_rate", "supplier", "supplier_name"):