From 125a352bc29b558cdbe3a0167b8ec5396a97a0b2 Mon Sep 17 00:00:00 2001 From: ljain112 Date: Fri, 6 Dec 2024 17:41:44 +0530 Subject: [PATCH] fix: allow all dispatch address for drop ship invoice --- erpnext/public/js/queries.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/queries.js b/erpnext/public/js/queries.js index fd5b7603844..46958092199 100644 --- a/erpnext/public/js/queries.js +++ b/erpnext/public/js/queries.js @@ -99,9 +99,12 @@ $.extend(erpnext.queries, { }, dispatch_address_query: function (doc) { + var filters = { link_doctype: "Company", link_name: doc.company || "" }; + var is_drop_ship = doc.items.some((item) => item.delivered_by_supplier); + if (is_drop_ship) filters = {}; return { query: "frappe.contacts.doctype.address.address.address_query", - filters: { link_doctype: "Company", link_name: doc.company || "" }, + filters: filters, }; },