fix: update reference doctype mapping and field visibility in bank guarantee

(cherry picked from commit b1de654dfd)

# Conflicts:
#	erpnext/accounts/doctype/bank_guarantee/bank_guarantee.json
This commit is contained in:
nareshkannasln
2026-05-26 12:39:51 +05:30
committed by ruthra kumar
parent ad9c16073e
commit e556cbbe6a
2 changed files with 13 additions and 6 deletions

View File

@@ -9,6 +9,13 @@ cur_frm.add_fetch("bank", "swift_number", "swift_number");
frappe.ui.form.on("Bank Guarantee", { frappe.ui.form.on("Bank Guarantee", {
setup: function (frm) { setup: function (frm) {
frm.set_query("reference_doctype", function () {
return {
filters: {
name: ["in", ["Sales Order", "Purchase Order"]],
},
};
});
frm.set_query("bank_account", function () { frm.set_query("bank_account", function () {
return { return {
filters: { filters: {

View File

@@ -1,5 +1,6 @@
{ {
"actions": [], "actions": [],
"allow_bulk_edit": 1,
"autoname": "ACC-BG-.YYYY.-.#####", "autoname": "ACC-BG-.YYYY.-.#####",
"creation": "2016-12-17 10:43:35.731631", "creation": "2016-12-17 10:43:35.731631",
"doctype": "DocType", "doctype": "DocType",
@@ -50,8 +51,7 @@
"fieldname": "reference_doctype", "fieldname": "reference_doctype",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Reference Document Type", "label": "Reference Document Type",
"options": "DocType", "options": "DocType"
"read_only": 1
}, },
{ {
"fieldname": "reference_docname", "fieldname": "reference_docname",
@@ -60,14 +60,14 @@
"options": "reference_doctype" "options": "reference_doctype"
}, },
{ {
"depends_on": "eval: doc.bg_type == \"Receiving\"", "depends_on": "eval: doc.reference_doctype == \"Sales Order\"",
"fieldname": "customer", "fieldname": "customer",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Customer", "label": "Customer",
"options": "Customer" "options": "Customer"
}, },
{ {
"depends_on": "eval: doc.bg_type == \"Providing\"", "depends_on": "eval: doc.reference_doctype == \"Purchase Order\"",
"fieldname": "supplier", "fieldname": "supplier",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Supplier", "label": "Supplier",
@@ -217,11 +217,11 @@
], ],
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2025-09-26 00:38:17.584694", "modified": "2026-05-25 18:12:10.768835",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Bank Guarantee", "name": "Bank Guarantee",
"naming_rule": "Expression (old style)", "naming_rule": "Expression",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {