From dc9ae20db8d8a8abf234628a7518051e2fefc9cf Mon Sep 17 00:00:00 2001 From: nareshkannasln Date: Tue, 26 May 2026 12:39:51 +0530 Subject: [PATCH] fix: update reference doctype mapping and field visibility in bank guarantee (cherry picked from commit b1de654dfd71cfa5c86e5f57d13da8d4f6d90007) --- .../accounts/doctype/bank_guarantee/bank_guarantee.js | 7 +++++++ .../doctype/bank_guarantee/bank_guarantee.json | 11 ++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js index c34e0f9099c..8d36c731d37 100644 --- a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js +++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js @@ -9,6 +9,13 @@ cur_frm.add_fetch("bank", "swift_number", "swift_number"); frappe.ui.form.on("Bank Guarantee", { setup: function (frm) { + frm.set_query("reference_doctype", function () { + return { + filters: { + name: ["in", ["Sales Order", "Purchase Order"]], + }, + }; + }); frm.set_query("bank_account", function () { return { filters: { diff --git a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.json b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.json index da935b3ffe1..46fe75d746b 100644 --- a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.json +++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.json @@ -1,5 +1,6 @@ { "actions": [], + "allow_bulk_edit": 1, "autoname": "ACC-BG-.YYYY.-.#####", "creation": "2016-12-17 10:43:35.731631", "doctype": "DocType", @@ -50,8 +51,7 @@ "fieldname": "reference_doctype", "fieldtype": "Link", "label": "Reference Document Type", - "options": "DocType", - "read_only": 1 + "options": "DocType" }, { "fieldname": "reference_docname", @@ -60,14 +60,14 @@ "options": "reference_doctype" }, { - "depends_on": "eval: doc.bg_type == \"Receiving\"", + "depends_on": "eval: doc.reference_doctype == \"Sales Order\"", "fieldname": "customer", "fieldtype": "Link", "label": "Customer", "options": "Customer" }, { - "depends_on": "eval: doc.bg_type == \"Providing\"", + "depends_on": "eval: doc.reference_doctype == \"Purchase Order\"", "fieldname": "supplier", "fieldtype": "Link", "label": "Supplier", @@ -218,10 +218,11 @@ "grid_page_length": 50, "is_submittable": 1, "links": [], - "modified": "2025-08-29 11:52:33.550847", + "modified": "2026-05-25 18:12:10.768835", "modified_by": "Administrator", "module": "Accounts", "name": "Bank Guarantee", + "naming_rule": "Expression", "owner": "Administrator", "permissions": [ {