Browse Source
Merge pull request #26132 from noahjacob/shipping_address_fix
fix: fetch preferred shipping address
develop
Deepesh Garg
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
2 deletions
-
erpnext/accounts/custom/address.py
-
erpnext/public/js/utils/party.js
|
|
@ -33,6 +33,8 @@ def get_shipping_address(company, address = None): |
|
|
|
if address and frappe.db.get_value('Dynamic Link', |
|
|
|
{'parent': address, 'link_name': company}): |
|
|
|
filters.append(["Address", "name", "=", address]) |
|
|
|
if not address: |
|
|
|
filters.append(["Address", "is_shipping_address", "=", 1]) |
|
|
|
|
|
|
|
address = frappe.get_all("Address", filters=filters, fields=fields) or {} |
|
|
|
|
|
|
|
|
|
@ -274,9 +274,9 @@ erpnext.utils.validate_mandatory = function(frm, label, value, trigger_on) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
erpnext.utils.get_shipping_address = function(frm, callback){ |
|
|
|
erpnext.utils.get_shipping_address = function(frm, callback) { |
|
|
|
if (frm.doc.company) { |
|
|
|
if (!(frm.doc.inter_com_order_reference || frm.doc.internal_invoice_reference || |
|
|
|
if ((frm.doc.inter_company_order_reference || frm.doc.internal_invoice_reference || |
|
|
|
frm.doc.internal_order_reference)) { |
|
|
|
if (callback) { |
|
|
|
return callback(); |
|
|
|