AttributeError: 'PaymentEntryReference' object has no attribute 'against_voucher_type'

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)”
}

Github Issue: AttributeError: 'PaymentEntryReference' object has no attribute 'against_voucher_type' Possible source of error: erpnext (app) · Issue #48739 · frappe/erpnext · GitHub

It says on GitHub that this issue was fixed but I’m still getting this error after the last update to ERPNext 15.78.1 on Payment Entry Submit.
Did your issue get solved? Before my update I was on 15.74 and after the 15.78 update I can create a new Payment Entry but can’t submit it…

ERPNext: v15.78.1
Frappe Framework: v15.80.0
AttributeError: 'PaymentEntryReference' object has no attribute 'advance_voucher_type'
Possible source of error: **erpnext (app)**
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 52, in handle
    data = execute_cmd(cmd)
           ^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 85, 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 37, in savedocs
    doc.submit()
  File "apps/frappe/frappe/utils/typing_validations.py", line 32, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1097, in submit
    return self._submit()
           ^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1080, in _submit
    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 1180, in run_post_save_methods
    self.run_method("on_submit")
  File "apps/frappe/frappe/model/document.py", line 1011, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1371, in composer
    return composed(self, method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1353, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1008, in fn
    return method_object(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py", line 122, in on_submit
    self.make_gl_entries()
  File "apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py", line 1295, in make_gl_entries
    gl_entries = self.build_gl_map()
                 ^^^^^^^^^^^^^^^^^^^
  File "apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py", line 1287, in build_gl_map
    self.add_party_gl_entries(gl_entries)
  File "apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py", line 1365, in add_party_gl_entries
    "advance_voucher_type": d.advance_voucher_type,
                            ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'PaymentEntryReference' object has no attribute 'advance_voucher_type'