fix: set billing_address for purchases in get_party_details

(cherry picked from commit a3625b3817)
This commit is contained in:
Sagar Vora
2022-07-29 12:41:40 +05:30
parent 0569f8a857
commit a7d66fa352
3 changed files with 25 additions and 24 deletions

View File

@@ -1,7 +1,6 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.provide('erpnext.accounts.dimensions');
erpnext.TransactionController = erpnext.taxes_and_totals.extend({
setup: function() {
@@ -910,24 +909,6 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
set_party_account(set_pricing);
});
// Get default company billing address in Purchase Invoice, Order and Receipt
if (this.frm.doc.company && frappe.meta.get_docfield(this.frm.doctype, "billing_address")) {
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 || ""},
debounce: 2000,
callback: function(r) {
if (r.message) {
me.frm.set_value("billing_address", r.message);
} else {
if (frappe.meta.get_docfield(me.frm.doctype, 'company_address')) {
me.frm.set_value("company_address", "");
}
}
}
});
}
} else {
set_party_account(set_pricing);
}