mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
fix: set billing and shipping address on change of company
This commit is contained in:
@@ -157,10 +157,13 @@ erpnext.buying = {
|
||||
if(!frappe.meta.has_field(this.frm.doc.doctype, "billing_address")) return;
|
||||
|
||||
frappe.call({
|
||||
method: "erpnext.setup.doctype.company.company.get_default_company_address",
|
||||
method: "erpnext.setup.doctype.company.company.get_billing_shipping_address",
|
||||
args: { name: this.frm.doc.company, existing_address:this.frm.doc.billing_address },
|
||||
callback: (r) => {
|
||||
this.frm.set_value("billing_address", r.message || "");
|
||||
this.frm.set_value("billing_address", r.message.primary_address || "");
|
||||
|
||||
if(!frappe.meta.has_field(this.frm.doc.doctype, "shipping_address")) return;
|
||||
this.frm.set_value("shipping_address", r.message.shipping_address || "");
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user