From e556cbbe6a36c094ed33e1cf484c21bc792b3c6c 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) # Conflicts: # erpnext/accounts/doctype/bank_guarantee/bank_guarantee.json --- .../doctype/bank_guarantee/bank_guarantee.js | 7 +++++++ .../doctype/bank_guarantee/bank_guarantee.json | 12 ++++++------ 2 files changed, 13 insertions(+), 6 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 c255ce7ba8f..42e92613ea8 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", @@ -217,11 +217,11 @@ ], "is_submittable": 1, "links": [], - "modified": "2025-09-26 00:38:17.584694", + "modified": "2026-05-25 18:12:10.768835", "modified_by": "Administrator", "module": "Accounts", "name": "Bank Guarantee", - "naming_rule": "Expression (old style)", + "naming_rule": "Expression", "owner": "Administrator", "permissions": [ {