From c0b32c446bd1dd94302d12787977bbec8781ec48 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Thu, 30 Jan 2025 17:29:31 +0530 Subject: [PATCH] fix: bind this to function (cherry picked from commit 41649cf52de0fb50b6370d915ea41b7ad8fc9971) --- erpnext/buying/doctype/purchase_order/purchase_order.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 4cc38391276..3a15c7de4ba 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -367,7 +367,11 @@ erpnext.buying.PurchaseOrderController = class PurchaseOrderController extends ( } if (is_drop_ship && doc.status != "Delivered") { - this.frm.add_custom_button(__("Delivered"), this.delivered_by_supplier, __("Status")); + this.frm.add_custom_button( + __("Delivered"), + this.delivered_by_supplier.bind(this), + __("Status") + ); this.frm.page.set_inner_btn_group_as_primary(__("Status")); }