Hello Everyone,
when we made a reversal journal entry of the journal, we get th…e following error message
for **Asset Account:**
you can select reference document only if account gets credited
for **Liability Account**
you can select reference document only if account gets debited
## Steps to reproduce the issue
1. create Journal entry that includes **Asset account** (such as cash ) as **Credit** account

2. make reverse journal entry

3. Reverse will create draft journal entry that includes **Asset account** (such as cash ) as **Debit** account, in addition add the original journal entry as reference Name


4. when try to save the reversal journal entry, below error will be appeared

### Observed result
Reversal process prevent create reversal journal entry with Asset account when it is Debit, or Liability Account when it is Credit. since Reversal process set the original journal entry as reference name and that trigger the error condition in **journal_entry.py** file.
### Expected result
we wondering about the hidden logic around this error message, especially the standard behavior in erpnext when reverse journal to but the main Jv type && name in reference of both accounts entry
### Stacktrace / full error message
Traceback (most recent call last):
File "/opt/bench/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 21, in savedocs
doc.save()
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 284, in save
return self._save(*args, **kwargs)
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 306, in _save
self.insert()
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 237, in insert
self.run_before_save_methods()
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 960, in run_before_save_methods
self.run_method("validate")
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 858, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 1147, in composer
return composed(self, method, *args, **kwargs)
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 1130, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 852, in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/opt/bench/frappe-bench/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 47, in validate
self.validate_against_jv()
File "/opt/bench/frappe-bench/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 237, in validate_against_jv
.format(d.idx, d.account))
File "/opt/bench/frappe-bench/apps/frappe/frappe/__init__.py", line 432, in throw
msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File "/opt/bench/frappe-bench/apps/frappe/frappe/__init__.py", line 411, in msgprint
_raise_exception()
File "/opt/bench/frappe-bench/apps/frappe/frappe/__init__.py", line 365, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: Row #2: For Cash - A, you can select reference document only if account gets credited
request.js:387:14
Traceback (most recent call last):
File "/opt/bench/frappe-bench/apps/frappe/frappe/app.py", line 68, in application
response = frappe.api.handle()
File "/opt/bench/frappe-bench/apps/frappe/frappe/api.py", line 54, in handle
return frappe.handler.handle()
File "/opt/bench/frappe-bench/apps/frappe/frappe/handler.py", line 31, in handle
data = execute_cmd(cmd)
File "/opt/bench/frappe-bench/apps/frappe/frappe/handler.py", line 67, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/opt/bench/frappe-bench/apps/frappe/frappe/__init__.py", line 1174, in call
return fn(*args, **newargs)
File "/opt/bench/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 21, in savedocs
doc.save()
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 284, in save
return self._save(*args, **kwargs)
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 306, in _save
self.insert()
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 237, in insert
self.run_before_save_methods()
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 960, in run_before_save_methods
self.run_method("validate")
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 858, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 1147, in composer
return composed(self, method, *args, **kwargs)
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 1130, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/opt/bench/frappe-bench/apps/frappe/frappe/model/document.py", line 852, in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/opt/bench/frappe-bench/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 47, in validate
self.validate_against_jv()
File "/opt/bench/frappe-bench/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 237, in validate_against_jv
.format(d.idx, d.account))
File "/opt/bench/frappe-bench/apps/frappe/frappe/__init__.py", line 432, in throw
msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File "/opt/bench/frappe-bench/apps/frappe/frappe/__init__.py", line 411, in msgprint
_raise_exception()
File "/opt/bench/frappe-bench/apps/frappe/frappe/__init__.py", line 365, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: Row #2: For Cash - A, you can select reference document only if account gets credited
Best Regards,