mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 12:19:12 +00:00
Merge pull request #45255 from frappe/mergify/bp/version-15-hotfix/pr-45074
fix: set billing and shipping address on change of company (backport #45074)
This commit is contained in:
@@ -157,10 +157,17 @@ 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",
|
||||
args: { name: this.frm.doc.company, existing_address:this.frm.doc.billing_address },
|
||||
method: "erpnext.setup.doctype.company.company.get_billing_shipping_address",
|
||||
args: {
|
||||
name: this.frm.doc.company,
|
||||
billing_address:this.frm.doc.billing_address,
|
||||
shipping_address: this.frm.doc.shipping_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