Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core Change: ERPNext Account can only be linked to one Bank Account #91

Closed
marination opened this issue Feb 29, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@marination
Copy link
Member

marination commented Feb 29, 2024

Currently we allow many to one linking between Bank Accounts and an ERPNext Account
Solution:
On Linking account, prompt user a Bank Account selection as well.

Will work for existing users until they re-link accounts. Add a Note on migrate

@barredterra barredterra added the bug Something isn't working label Mar 11, 2024
@barredterra
Copy link
Member

barredterra commented Mar 11, 2024

Here's a related Error Log:

Title

Kosma Error - Bank Account Update

Error

Traceback (most recent call last):
  File "apps/banking/banking/klarna_kosma_integration/utils.py", line 209, in update_account
    account.save()
  File "apps/frappe/frappe/model/document.py", line 305, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 340, in _save
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1045, in run_before_save_methods
    self.run_method("validate")
  File "apps/frappe/frappe/model/document.py", line 915, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1267, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1249, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 912, in fn
    return method_object(*args, **kwargs)
  File "apps/erpnext/erpnext/accounts/doctype/bank_account/bank_account.py", line 29, in validate
    self.validate_account()
  File "apps/erpnext/erpnext/accounts/doctype/bank_account/bank_account.py", line 36, in validate_account
    frappe.throw(
  File "apps/frappe/frappe/__init__.py", line 538, in throw
    msgprint(
  File "apps/frappe/frappe/__init__.py", line 506, in msgprint
    _raise_exception()
  File "apps/frappe/frappe/__init__.py", line 452, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.ValidationError: '<strong>1800 - Bank - TC</strong>' account is already used by <strong><a href="/app/bank-account/REDACTED_IBAN">REDACTED_IBAN</a></strong>. Use another account.

This one can be resolved by manually removing the used Account from other existing Bank Accounts.

barredterra added a commit that referenced this issue Mar 12, 2024
barredterra pushed a commit that referenced this issue Mar 12, 2024
# [0.1.0](v0.0.16...v0.1.0) (2024-03-12)

### Features

* add option for test environment ([cd4ca07](cd4ca07))
* bank account selection ([f36ae93](f36ae93)), closes [#91](#91) [#69](#69)
barredterra pushed a commit that referenced this issue Mar 13, 2024
# [15.1.0](v15.0.0...v15.1.0) (2024-03-13)

### Bug Fixes

* handle empty error object ([5c2ecae](5c2ecae))

### Features

* add option for test environment ([a21803e](a21803e))
* bank account selection ([1cc874d](1cc874d)), closes [#91](#91) [#69](#69)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants