From 666eaae6ce976c5d820b3b9f91d23a0ed28a263a Mon Sep 17 00:00:00 2001 From: vama Date: Sat, 18 Sep 2021 13:21:45 +0530 Subject: [PATCH] fix: PO/PINV - Check if doctype has company_address field before setting the value (#27441) Co-authored-by: Vama Mehta --- erpnext/public/js/controllers/transaction.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 6c1d5f9898e..d4f5cb85ceb 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -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", ""); + } } } });