You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.1 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :alt: License: AGPL-3
  3. Unique bank account numbers
  4. ===========================
  5. It can be desirable to be able to rely on a bank account number identifying
  6. exactly one partner. This module allows you to enforce this, so that an
  7. account number is unique in the system.
  8. Installation
  9. ============
  10. During installation, the module checks if your bank account numbers are
  11. unique already. If this is not the case, you won't be able to install the
  12. module until duplicates are fixed.
  13. The error message only shows the first few duplicates, in order to find all
  14. of them, use the following statement::
  15. with res_partner_bank_sanitized as (
  16. select
  17. id, acc_number,
  18. regexp_replace(acc_number, '\W+', '', 'g') acc_number_sanitized
  19. from res_partner_bank
  20. ),
  21. res_partner_bank_sanitized_grouped as (
  22. select
  23. array_agg(id) ids, acc_number_sanitized, count(*) amount
  24. from res_partner_bank_sanitized group by acc_number_sanitized
  25. )
  26. select * from res_partner_bank_sanitized_grouped where amount > 1;
  27. Bug Tracker
  28. ===========
  29. Bugs are tracked on `GitHub Issues <https://github.com/OCA/bank-statement-import/issues>`_.
  30. In case of trouble, please check there if your issue has already been reported.
  31. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
  32. `here <https://github.com/OCA/bank-statement-import/issues/new?body=module:%20base_bank_account_number_unique%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  33. Credits
  34. =======
  35. Contributors
  36. ------------
  37. * Holger Brunn <hbrunn@therp.nl>
  38. Maintainer
  39. ----------
  40. .. image:: https://odoo-community.org/logo.png
  41. :alt: Odoo Community Association
  42. :target: https://odoo-community.org
  43. This module is maintained by the OCA.
  44. OCA, or the Odoo Community Association, is a nonprofit organization whose
  45. mission is to support the collaborative development of Odoo features and
  46. promote its widespread use.
  47. To contribute to this module, please visit http://odoo-community.org.