fix: bind this object explicitly on callback event function

(cherry picked from commit 5e790a0fce)
This commit is contained in:
Kavin
2024-11-11 11:56:56 +05:30
committed by Mergify
parent f3ee439b33
commit 3423d3c13d

View File

@@ -65,7 +65,7 @@ erpnext.selling.POSInvoiceController = class POSInvoiceController extends erpnex
super.refresh(); super.refresh();
if (doc.docstatus == 1 && !doc.is_return) { 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")); this.frm.page.set_inner_btn_group_as_primary(__("Create"));
} }