Local variable 'expire_allocation' referenced before assignment (ERPNext: v12.0.8)

Dear colleages,

we observe the following error in ERPNext: v12.0.8:

{'method_name': 'erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry.process_expired_allocation', 'user': 'Administrator', 'event': 'daily_long', 'kwargs': {}, 'job_name': 'erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry.process_expired_allocation', 'site': 'portal.libracore.ch', 'log': <function log at 0x7fae6fd0dae8>, 'is_async': True, 'retry': 0, 'method': <function process_expired_allocation at 0x7fae6f3e26a8>}
Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 99, in execute_job
	method(**kwargs)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/leave_ledger_entry/leave_ledger_entry.py", line 119, in process_expired_allocation
	if expire_allocation:
UnboundLocalError: local variable 'expire_allocation' referenced before assignment

This should be caught before the exception occurs…

A fix is pending HR Module error logs seem to be a bug? - #5 by mangesh_khairnar

1 Like