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
parent
commit
e693cceb58
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      erpnext/accounts/custom/address.py
  2. 4
      erpnext/public/js/utils/party.js

2
erpnext/accounts/custom/address.py

@ -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 {}

4
erpnext/public/js/utils/party.js

@ -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();

Loading…
Cancel
Save