Fix potential crash in payment_entry.py (#15411)
The new code for cost center checking in payment_entry.py crashes if `voucher_type` is `None`, which is an explicit possibility if party type is Employee. This commit adds a simple check to make sure that voucher_type is not None before running `get_doc`.
This commit is contained in:
parent
e79e4cb9b1
commit
ba1c0c900d
@ -589,6 +589,7 @@ def get_orders_to_be_billed(posting_date, party_type, party, party_account_curre
|
||||
voucher_type = None
|
||||
|
||||
# Add cost center condition
|
||||
if voucher_type:
|
||||
doc = frappe.get_doc({"doctype": voucher_type})
|
||||
condition = ""
|
||||
if doc and hasattr(doc, 'cost_center'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user