From 0688c0ab6b2f7c92d4ca282835aa7b97cb8ad1e8 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 17 Dec 2024 17:40:32 +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 f014e6303ff..14d07230d0d 100644 --- a/erpnext/public/js/queries.js +++ b/erpnext/public/js/queries.js @@ -107,9 +107,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, }; },