Please help!
AttributeError: ‘PaymentEntryReference’ object has no attribute ‘against_voucher_type’ Possible source of error: erpnext (app)
Information about bug
Following error/BUG received while cancelling a Payment Entry after updated ERPNext last night
Module
accounts
Installation method
docker
Relevant log output / Stack trace / Full Error Message:
App Versions
{
“builder”: “1.18.0”,
“erpnext”: “15.70.2”,
“frappe”: “15.74.0”,
“hrms”: “15.47.7”,
“india_compliance”: “15.20.0”,
“lms”: “2.32.0”,
“print_designer”: “1.5.2”,
“raven”: “2.6.2”,
“wiki”: “2.0.0”
}
Route
Form/Payment Entry/ES-PYEN-2526-00173
Traceback
Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 115, in application
response = frappe.api.handle(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/api/init.py”, line 49, in handle
data = endpoint(**arguments)
^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/api/v1.py”, line 36, in handle_rpc_call
return frappe.handler.handle()
^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/handler.py”, line 51, in handle
data = execute_cmd(cmd)
^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/handler.py”, line 84, in execute_cmd
return frappe.call(method, **frappe.form_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/init.py”, line 1754, in call
return fn(*args, **newargs)
^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/utils/typing_validations.py”, line 32, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/desk/form/save.py”, line 58, in cancel
doc.cancel()
File “apps/frappe/frappe/utils/typing_validations.py”, line 32, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/model/document.py”, line 1098, in cancel
return self._cancel()
^^^^^^^^^^^^^^
File “apps/frappe/frappe/model/document.py”, line 1081, in _cancel
return self.save()
^^^^^^^^^^^
File “apps/frappe/frappe/model/document.py”, line 378, in save
return self._save(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/model/document.py”, line 431, in _save
self.run_post_save_methods()
File “apps/frappe/frappe/model/document.py”, line 1178, in run_post_save_methods
self.run_method(“on_cancel”)
File “apps/frappe/frappe/model/document.py”, line 1007, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/model/document.py”, line 1367, in composer
return composed(self, method, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/model/document.py”, line 1349, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/model/document.py”, line 1004, in fn
return method_object(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py”, line 225, in on_cancel
self.make_gl_entries(cancel=1)
File “apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py”, line 1307, in make_gl_entries
self.make_advance_gl_entries(cancel=cancel)
File “apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py”, line 1435, in make_advance_gl_entries
self.add_advance_gl_entries(gl_entries, entry)
File “apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py”, line 1458, in add_advance_gl_entries
self.add_advance_gl_for_reference(gl_entries, ref)
File “apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py”, line 1496, in add_advance_gl_for_reference
posting_date = get_reconciliation_effect_date(invoice, self.company, self.posting_date)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/erpnext/erpnext/accounts/utils.py”, line 782, in get_reconciliation_effect_date
if reference.against_voucher_type in [“Sales Order”, “Purchase Order”]:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: ‘PaymentEntryReference’ object has no attribute ‘against_voucher_type’
Request Data
{
“type”: “POST”,
“args”: {
“doctype”: “Payment Entry”,
“name”: “ES-PYEN-2526-00173”
},
“btn”: {
“jQuery370008074979096183911”: {
“events”: {
“click”: [
{
“type”: “click”,
“origType”: “click”,
“guid”: 928,
“namespace”: “”
}
]
}
}
},
“freeze”: true,
“headers”: {},
“error_handlers”: {},
“url”: “/api/method/frappe.desk.form.save.cancel”,
“request_id”: null
}
Response Data
{
“exception”: “AttributeError: ‘PaymentEntryReference’ object has no attribute ‘against_voucher_type’”,
“exc_type”: “AttributeError”,
“_exc_source”: “erpnext (app)”
}