fix: creation of return/credit note from sales invoice
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index cf01bdd..0011170 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -118,7 +118,11 @@
});
if (doc.outstanding_amount >= 0 || Math.abs(flt(doc.outstanding_amount)) < flt(doc.grand_total)) {
- this.frm.add_custom_button(__("Return / Credit Note"), this.make_sales_return, __("Create"));
+ this.frm.add_custom_button(
+ __("Return / Credit Note"),
+ this.make_sales_return.bind(this),
+ __("Create")
+ );
this.frm.page.set_inner_btn_group_as_primary(__("Create"));
}