From 4a394bcbf409c2d3516696f2b3941e3ff5dc666a Mon Sep 17 00:00:00 2001 From: Maxwell Morais Date: Thu, 23 Aug 2018 02:38:37 -0300 Subject: [PATCH] Fix shipping_address for DropShipping (#15202) This stretch of javascript go against the address definition for DropShipping. When we create an PO from SO with dropshipping items, the backend code update fine the shipping address, but this stretch of code, replace the customer address to the Company address. To reproduce that behavior, pick one sales order with Drop Shipping Items, make and purchase order, and take a look into the delivery address. --- erpnext/public/js/utils/party.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/public/js/utils/party.js b/erpnext/public/js/utils/party.js index 3a5a0624e8..fe2a992bc9 100644 --- a/erpnext/public/js/utils/party.js +++ b/erpnext/public/js/utils/party.js @@ -171,7 +171,7 @@ erpnext.utils.validate_mandatory = function(frm, label, value, trigger_on) { } erpnext.utils.get_shipping_address = function(frm, callback){ - if (frm.doc.company) { + if (frm.doc.company && !frm.doc.shipping_address) { frappe.call({ method: "frappe.contacts.doctype.address.address.get_shipping_address", args: { @@ -192,4 +192,4 @@ erpnext.utils.get_shipping_address = function(frm, callback){ } else { frappe.msgprint(__("Select company first")); } -} \ No newline at end of file +}