fix: COGS account in purchase receipt

This commit is contained in:
Rohit Waghchaure
2021-07-30 12:36:35 +05:30
parent 22eac9bd0c
commit 2a14f255cf
5 changed files with 25 additions and 12 deletions

View File

@@ -566,10 +566,10 @@ def remove_ref_doc_link_from_pe(ref_type, ref_no):
frappe.msgprint(_("Payment Entries {0} are un-linked").format("\n".join(linked_pe)))
@frappe.whitelist()
def get_company_default(company, fieldname):
value = frappe.get_cached_value('Company', company, fieldname)
def get_company_default(company, fieldname, ignore_validation=False):
value = frappe.get_cached_value('Company', company, fieldname)
if not value:
if not ignore_validation and not value:
throw(_("Please set default {0} in Company {1}")
.format(frappe.get_meta("Company").get_label(fieldname), company))