fix: fetches correct preferred shipping address
This commit is contained in:
parent
27f0495156
commit
b4b6288596
@ -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_com_order_reference || frm.doc.internal_invoice_reference ||
|
||||
frm.doc.internal_order_reference)) {
|
||||
if (callback) {
|
||||
return callback();
|
||||
|
Loading…
x
Reference in New Issue
Block a user