fix: PO/PINV - Check if doctype has company_address field before setting the value (#27441)

Co-authored-by: Vama Mehta <vama.mehta@inqubit.in>
This commit is contained in:
vama
2021-09-18 13:21:45 +05:30
committed by GitHub
parent 9ffb65b5a4
commit 666eaae6ce

View File

@@ -864,7 +864,9 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
if (r.message) {
me.frm.set_value("billing_address", r.message);
} else {
me.frm.set_value("company_address", "");
if (frappe.meta.get_docfield(me.frm.doctype, 'company_address')) {
me.frm.set_value("company_address", "");
}
}
}
});