mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-15 02:33:38 +00:00
fix: reset billing and shipping address when company changes
(cherry picked from commit 0510f7e13f)
This commit is contained in:
committed by
Mergify
parent
b5485dc909
commit
73b8a294cf
@@ -171,15 +171,13 @@ erpnext.buying = {
|
||||
shipping_address: this.frm.doc.shipping_address
|
||||
},
|
||||
callback: (r) => {
|
||||
if (!this.frm.doc.billing_address)
|
||||
this.frm.set_value("billing_address", r.message.primary_address || "");
|
||||
if (!r.message) return;
|
||||
|
||||
if (
|
||||
!frappe.meta.has_field(this.frm.doc.doctype, "shipping_address") ||
|
||||
this.frm.doc.shipping_address
|
||||
)
|
||||
return;
|
||||
this.frm.set_value("shipping_address", r.message.shipping_address || "");
|
||||
this.frm.set_value("billing_address", r.message.primary_address || "");
|
||||
|
||||
if (frappe.meta.has_field(this.frm.doc.doctype, "shipping_address")) {
|
||||
this.frm.set_value("shipping_address", r.message.shipping_address || "");
|
||||
}
|
||||
},
|
||||
});
|
||||
erpnext.utils.set_letter_head(this.frm)
|
||||
|
||||
Reference in New Issue
Block a user