frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
22.11k stars 7.4k forks source link

Plaid Bank transaction creation error #35657

Open mrPauwHaan opened 1 year ago

mrPauwHaan commented 1 year ago

Information about bug

Hello, I have just connected ERPNext with Plaid. The connection works but during import it stopped after 189 transactions because of a character length issue. However, the Plaid integration stopped syncing after this and also manual synchronization does not work.

Module

accounting

Version

Frappe - 14.38.0 ERPnext - 14.27.1

Installation method

None

Relevant log output / Stack trace / Full Error Message.

Traceback (most recent call last):
  File "apps/erpnext/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py", line 273, in new_bank_transaction
    new_transaction.insert()
  File "apps/frappe/frappe/model/document.py", line 260, in insert
    self._validate()
  File "apps/frappe/frappe/model/document.py", line 532, in _validate
    self._validate_length()
  File "apps/frappe/frappe/model/base_document.py", line 915, in _validate_length
    self.throw_length_exceeded_error(df, max_length, value)
  File "apps/frappe/frappe/model/base_document.py", line 949, in throw_length_exceeded_error
    frappe.throw(
  File "apps/frappe/frappe/__init__.py", line 526, in throw
    msgprint(
  File "apps/frappe/frappe/__init__.py", line 494, in msgprint
    _raise_exception()
  File "apps/frappe/frappe/__init__.py", line 443, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.CharacterLengthExceededError: [deleted because of private information]: 'Reference Number' ([deleted because of private information]) will get truncated, as max characters allowed is 140

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "apps/erpnext/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py", line 183, in sync_transactions
    result += new_bank_transaction(transaction)
  File "apps/erpnext/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py", line 282, in new_bank_transaction
    frappe.throw(_("Bank transaction creation error"))
  File "apps/frappe/frappe/__init__.py", line 526, in throw
    msgprint(
  File "apps/frappe/frappe/__init__.py", line 494, in msgprint
    _raise_exception()
  File "apps/frappe/frappe/__init__.py", line 443, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.ValidationError: Bank transaction creation error
mrPauwHaan commented 1 year ago

Is there someone with a solution/fix? Since I think it is a critical error that prevents us from using the accounting software.

Automatically importing transactions is not possible without Plaid.

ahandlen commented 1 year ago

Bumping as we are facing the same issue here.

mrPauwHaan commented 1 year ago

Changing the field type helped me to overcome the error. Atleast, I am now able to use the integration without issues.

However, there should still be a fix for this issue of course.

ahandlen commented 1 year ago

Beautiful solution that my tired brain couldn't think of. I sincerely thank you.

Changing the field type from data to text in bank transactions seemed to do the trick but I agree a permanent fix should still be implemented.