From 3423d3c13d3da909cdb1e165d04107b9bccee5d6 Mon Sep 17 00:00:00 2001 From: Kavin <78342682+kavin0411@users.noreply.github.com> Date: Mon, 11 Nov 2024 11:56:56 +0530 Subject: [PATCH] fix: bind this object explicitly on callback event function (cherry picked from commit 5e790a0fcea2e1e2f714aa8e312e9b9870b646e3) --- erpnext/accounts/doctype/pos_invoice/pos_invoice.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.js b/erpnext/accounts/doctype/pos_invoice/pos_invoice.js index deb8bd7529d..6a537a2559a 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.js +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.js @@ -65,7 +65,7 @@ erpnext.selling.POSInvoiceController = class POSInvoiceController extends erpnex super.refresh(); if (doc.docstatus == 1 && !doc.is_return) { - this.frm.add_custom_button(__("Return"), this.make_sales_return, __("Create")); + this.frm.add_custom_button(__("Return"), this.make_sales_return.bind(this), __("Create")); this.frm.page.set_inner_btn_group_as_primary(__("Create")); }