fix: move code from purchase invoice to buying controller

(cherry picked from commit cb197fd01f)
This commit is contained in:
Sanket322
2024-12-27 12:35:36 +05:30
committed by Mergify
parent cfa432dbca
commit 98631eb266
2 changed files with 12 additions and 8 deletions

View File

@@ -719,14 +719,6 @@ frappe.ui.form.on("Purchase Invoice", {
if (response) frm.set_value("credit_to", response.message);
},
});
frappe.call({
method: "erpnext.setup.doctype.company.company.get_default_company_address",
args: { name: frm.doc.company },
callback: (r) => {
frm.set_value("billing_address", r.message || "");
},
});
}
},
});

View File

@@ -145,6 +145,18 @@ erpnext.buying = {
});
}
company(){
if(this.frm.doc.doctype == "Material Request") 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 },
callback: (r) => {
this.frm.set_value("billing_address", r.message || "");
},
});
}
supplier_address() {
erpnext.utils.get_address_display(this.frm);
erpnext.utils.set_taxes_from_address(this.frm, "supplier_address", "supplier_address", "supplier_address");