Merge pull request #9674 from nextchamp-saqib/no_currency_field_found

fix: currency field not found in print formats
This commit is contained in:
mergify[bot] 2020-03-13 15:05:57 +00:00 committed by GitHub
commit ef8a95ec55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -529,7 +529,9 @@ def get_field_currency(df, doc=None):
if currency:
ref_docname = doc.name
else:
currency = frappe.db.get_value(doc.parenttype, doc.parent, df.get("options"))
if frappe.get_meta(doc.parenttype).has_field(df.get("options")):
# only get_value if parent has currency field
currency = frappe.db.get_value(doc.parenttype, doc.parent, df.get("options"))
if currency:
frappe.local.field_currency.setdefault((doc.doctype, ref_docname), frappe._dict())\