mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-28 07:31:31 +01:00
fix: pass right existing address
(cherry picked from commit ce99764772)
This commit is contained in:
@@ -158,7 +158,11 @@ erpnext.buying = {
|
|||||||
|
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "erpnext.setup.doctype.company.company.get_billing_shipping_address",
|
method: "erpnext.setup.doctype.company.company.get_billing_shipping_address",
|
||||||
args: { name: this.frm.doc.company, existing_address:this.frm.doc.billing_address },
|
args: {
|
||||||
|
name: this.frm.doc.company,
|
||||||
|
billing_address:this.frm.doc.billing_address,
|
||||||
|
shipping_address: this.frm.doc.shipping_address
|
||||||
|
},
|
||||||
callback: (r) => {
|
callback: (r) => {
|
||||||
this.frm.set_value("billing_address", r.message.primary_address || "");
|
this.frm.set_value("billing_address", r.message.primary_address || "");
|
||||||
|
|
||||||
|
|||||||
@@ -915,11 +915,11 @@ def get_default_company_address(name, sort_key="is_primary_address", existing_ad
|
|||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_billing_shipping_address(name, existing_address=None):
|
def get_billing_shipping_address(name, billing_address=None, shipping_address=None):
|
||||||
primart_address = get_default_company_address(name, "is_primary_address", existing_address)
|
primary_address = get_default_company_address(name, "is_primary_address", billing_address)
|
||||||
shipping_address = get_default_company_address(name, "is_shipping_address", existing_address)
|
shipping_address = get_default_company_address(name, "is_shipping_address", shipping_address)
|
||||||
|
|
||||||
return {"primary_address": primart_address, "shipping_address": shipping_address}
|
return {"primary_address": primary_address, "shipping_address": shipping_address}
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
|
|||||||
Reference in New Issue
Block a user