mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 04:59:18 +00:00
[Fix] Getting an error cost center is not defined in the purchase receipt, even if it's defined in the company (#10320)
This commit is contained in:
committed by
Nabin Hait
parent
aac8349391
commit
2e8232e7aa
@@ -28,6 +28,16 @@ def get_default_currency():
|
||||
if company:
|
||||
return frappe.db.get_value('Company', company, 'default_currency')
|
||||
|
||||
def get_default_cost_center(company):
|
||||
'''Returns the default cost center of the company'''
|
||||
if not company:
|
||||
return None
|
||||
|
||||
if not frappe.flags.company_cost_center:
|
||||
frappe.flags.company_cost_center = {}
|
||||
if not company in frappe.flags.company_cost_center:
|
||||
frappe.flags.company_cost_center[company] = frappe.db.get_value('Company', company, 'cost_center')
|
||||
return frappe.flags.company_cost_center[company]
|
||||
|
||||
def get_company_currency(company):
|
||||
'''Returns the default company currency'''
|
||||
|
||||
Reference in New Issue
Block a user