diff --git a/account_banking_ach_credit_transfer/README.rst b/account_banking_ach_credit_transfer/README.rst new file mode 100644 index 00000000..54d1327c --- /dev/null +++ b/account_banking_ach_credit_transfer/README.rst @@ -0,0 +1,96 @@ +=================================== +Account Banking ACH Credit Transfer +=================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:2acfd000956b8377b952111df800a0ded3a4272a185ab1ce5ba3b446e19153c5 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--usa-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-usa/tree/16.0/account_banking_ach_credit_transfer + :alt: OCA/l10n-usa +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/l10n-usa-16-0/l10n-usa-16-0-account_banking_ach_credit_transfer + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-usa&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Create ACH files for Credit Transfers + +Module to export credit transfers in Nacha file format. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +This module depends on : + +* account_banking_ach_base +* carta-ach +* stdnum + +Configuration +============= + +1. Your Company record must have the Legal ID specified. +2. Your Bank must have the Routing Number specified. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Thinkwell Designs + +Contributors +~~~~~~~~~~~~ + +* Dave Burkholder +* Maxime Chambreuil +* Serpent Consulting Services Pvt. Ltd. +* Murtaza Mithaiwala + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/l10n-usa `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_banking_ach_credit_transfer/__init__.py b/account_banking_ach_credit_transfer/__init__.py new file mode 100644 index 00000000..f1a6eca6 --- /dev/null +++ b/account_banking_ach_credit_transfer/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models +from .post_install import update_bank_journals diff --git a/account_banking_ach_credit_transfer/__manifest__.py b/account_banking_ach_credit_transfer/__manifest__.py new file mode 100644 index 00000000..8c6d8423 --- /dev/null +++ b/account_banking_ach_credit_transfer/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2018 Thinkwell Designs +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Account Banking ACH Credit Transfer", + "summary": "Create ACH files for Credit Transfers", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "Thinkwell Designs, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/l10n-usa", + "category": "Banking addons", + "depends": ["account_banking_ach_base"], + "data": ["data/account_payment_method.xml"], + "demo": ["demo/ach_credit_transfer_demo.xml"], + "post_init_hook": "update_bank_journals", + "installable": True, +} diff --git a/account_banking_ach_credit_transfer/data/account_payment_method.xml b/account_banking_ach_credit_transfer/data/account_payment_method.xml new file mode 100644 index 00000000..a91cbb0d --- /dev/null +++ b/account_banking_ach_credit_transfer/data/account_payment_method.xml @@ -0,0 +1,10 @@ + + + + ACH + ACH-Out + outbound + + + + diff --git a/account_banking_ach_credit_transfer/demo/ach_credit_transfer_demo.xml b/account_banking_ach_credit_transfer/demo/ach_credit_transfer_demo.xml new file mode 100644 index 00000000..84816f6d --- /dev/null +++ b/account_banking_ach_credit_transfer/demo/ach_credit_transfer_demo.xml @@ -0,0 +1,21 @@ + + + + ACH + + variable + + + + + + + + + + + + diff --git a/account_banking_ach_credit_transfer/i18n/account_banking_ach_credit_transfer.pot b/account_banking_ach_credit_transfer/i18n/account_banking_ach_credit_transfer.pot new file mode 100644 index 00000000..28e21016 --- /dev/null +++ b/account_banking_ach_credit_transfer/i18n/account_banking_ach_credit_transfer.pot @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_ach_credit_transfer +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_banking_ach_credit_transfer +#: model:account.payment.method,name:account_banking_ach_credit_transfer.ach_credit_transfer +#: model:account.payment.mode,name:account_banking_ach_credit_transfer.payment_mode_outbound_ach_ct1 +msgid "ACH" +msgstr "" + +#. module: account_banking_ach_credit_transfer +#: model:ir.model,name:account_banking_ach_credit_transfer.model_account_payment_order +msgid "Payment Order" +msgstr "" diff --git a/account_banking_ach_credit_transfer/models/__init__.py b/account_banking_ach_credit_transfer/models/__init__.py new file mode 100644 index 00000000..ebe64a38 --- /dev/null +++ b/account_banking_ach_credit_transfer/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import account_payment_order diff --git a/account_banking_ach_credit_transfer/models/account_payment_order.py b/account_banking_ach_credit_transfer/models/account_payment_order.py new file mode 100644 index 00000000..fe7f82a2 --- /dev/null +++ b/account_banking_ach_credit_transfer/models/account_payment_order.py @@ -0,0 +1,15 @@ +from odoo import models + + +class AccountPaymentOrder(models.Model): + _inherit = "account.payment.order" + + def generate_payment_file(self): + """ + Creates the ACH Credit Transfer file by calling + generate_ach_file in countinghouse_ach_base + """ + self.ensure_one() + if self.payment_method_id.code == "ACH-Out": + return self.generate_ach_file() + return super(AccountPaymentOrder, self).generate_payment_file() diff --git a/account_banking_ach_credit_transfer/post_install.py b/account_banking_ach_credit_transfer/post_install.py new file mode 100644 index 00000000..4c681ab6 --- /dev/null +++ b/account_banking_ach_credit_transfer/post_install.py @@ -0,0 +1,15 @@ +# Copyright 2018 Thinkwell Designs +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import SUPERUSER_ID, api + + +def update_bank_journals(cr, registry): + env = api.Environment(cr, SUPERUSER_ID, {}) + journals = env["account.journal"].search([("type", "=", "bank")]) + ach_ct = env.ref( + "account_banking_ach_credit_transfer.ach_credit_transfer", + raise_if_not_found=False, + ) + if ach_ct: + journals.write({"outbound_payment_method_line_ids": [(4, ach_ct.id)]}) diff --git a/account_banking_ach_credit_transfer/readme/CONFIGURE.rst b/account_banking_ach_credit_transfer/readme/CONFIGURE.rst new file mode 100644 index 00000000..502d45ac --- /dev/null +++ b/account_banking_ach_credit_transfer/readme/CONFIGURE.rst @@ -0,0 +1,2 @@ +1. Your Company record must have the Legal ID specified. +2. Your Bank must have the Routing Number specified. diff --git a/account_banking_ach_credit_transfer/readme/CONTRIBUTORS.rst b/account_banking_ach_credit_transfer/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..1c48c3e7 --- /dev/null +++ b/account_banking_ach_credit_transfer/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* Dave Burkholder +* Maxime Chambreuil +* Serpent Consulting Services Pvt. Ltd. +* Murtaza Mithaiwala diff --git a/account_banking_ach_credit_transfer/readme/DESCRIPTION.rst b/account_banking_ach_credit_transfer/readme/DESCRIPTION.rst new file mode 100644 index 00000000..12708993 --- /dev/null +++ b/account_banking_ach_credit_transfer/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +Create ACH files for Credit Transfers + +Module to export credit transfers in Nacha file format. diff --git a/account_banking_ach_credit_transfer/readme/INSTALL.rst b/account_banking_ach_credit_transfer/readme/INSTALL.rst new file mode 100644 index 00000000..b869995a --- /dev/null +++ b/account_banking_ach_credit_transfer/readme/INSTALL.rst @@ -0,0 +1,5 @@ +This module depends on : + +* account_banking_ach_base +* carta-ach +* stdnum diff --git a/account_banking_ach_credit_transfer/static/description/icon.png b/account_banking_ach_credit_transfer/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/account_banking_ach_credit_transfer/static/description/icon.png differ diff --git a/account_banking_ach_credit_transfer/static/description/index.html b/account_banking_ach_credit_transfer/static/description/index.html new file mode 100644 index 00000000..b3729e57 --- /dev/null +++ b/account_banking_ach_credit_transfer/static/description/index.html @@ -0,0 +1,445 @@ + + + + + +Account Banking ACH Credit Transfer + + + +
+

Account Banking ACH Credit Transfer

+ + +

Beta License: AGPL-3 OCA/l10n-usa Translate me on Weblate Try me on Runboat

+

Create ACH files for Credit Transfers

+

Module to export credit transfers in Nacha file format.

+

Table of contents

+ +
+

Installation

+

This module depends on :

+
    +
  • account_banking_ach_base
  • +
  • carta-ach
  • +
  • stdnum
  • +
+
+
+

Configuration

+
    +
  1. Your Company record must have the Legal ID specified.
  2. +
  3. Your Bank must have the Routing Number specified.
  4. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Thinkwell Designs
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/l10n-usa project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/account_banking_ach_credit_transfer/tests/__init__.py b/account_banking_ach_credit_transfer/tests/__init__.py new file mode 100644 index 00000000..5130fa49 --- /dev/null +++ b/account_banking_ach_credit_transfer/tests/__init__.py @@ -0,0 +1 @@ +from . import test_account_banking_ach_credit_trasnfer diff --git a/account_banking_ach_credit_transfer/tests/test_account_banking_ach_credit_trasnfer.py b/account_banking_ach_credit_transfer/tests/test_account_banking_ach_credit_trasnfer.py new file mode 100644 index 00000000..59216b97 --- /dev/null +++ b/account_banking_ach_credit_transfer/tests/test_account_banking_ach_credit_trasnfer.py @@ -0,0 +1,83 @@ +# Copyright (C) 2024, ForgeFlow S.A. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +from datetime import datetime + +from odoo.tests.common import TransactionCase + + +class TestACHCreditTransfer(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.partner = cls.env["res.partner"].create({"name": "Partner 1"}) + cls.company = cls.env.ref("base.main_company") + cls.company.partner_id = cls.partner.id + cls.company.legal_id_number = "12-3456789" + cls.payment_method_model = cls.env["account.payment.method"] + cls.ach_out_payment_method = cls.payment_method_model.search( + [("code", "=", "ACH-Out")], limit=1 + ) + cls.acme_bank = cls.env["res.bank"].create( + { + "name": "ACME Bank", + "bic": "GEBABEBB03B", + "city": "Charleroi", + "routing_number": "021000021", + "country": cls.env.ref("base.be").id, + } + ) + bank_account = cls.env["res.partner.bank"].create( + { + "acc_number": "0023032234211123", + "partner_id": cls.partner.id, + "bank_id": cls.acme_bank.id, + "company_id": cls.company.id, + } + ) + cls.bank_journal = cls.env["account.journal"].create( + { + "name": "Journal 1", + "code": "J1", + "type": "bank", + "company_id": cls.company.id, + "bank_account_id": bank_account.id, + } + ) + cls.payment_mode = cls.env.ref( + "account_banking_ach_credit_transfer.payment_mode_outbound_ach_ct1" + ) + cls.payment_mode.variable_journal_ids += cls.bank_journal + + def test_account_payment_order(self): + + self.payment_order = self.env["account.payment.order"].create( + { + "payment_type": "outbound", + "payment_mode_id": self.payment_mode.id, + "journal_id": self.bank_journal.id, + "payment_method_id": self.ach_out_payment_method.id, + } + ) + line_created_due = ( + self.env["account.payment.line.create"] + .with_context( + active_model="account.payment.order", active_id=self.payment_order.id + ) + .create({"date_type": "due", "due_date": datetime.now()}) + ) + line_created_due.payment_mode = "any" + line_created_due.target_move = "all" + line_created_due.allow_blocked = True + line_created_due.populate() + line_created_due.create_payment_lines() + self.assertEqual(len(line_created_due.move_line_ids), 1) + line_created_due.move_line_ids.partner_id.bank_ids.bank_id.routing_number = ( + 35645 + ) + self.assertEqual(self.payment_order.state, "draft") + self.payment_order.draft2open() + self.assertEqual(self.payment_order.state, "open") + self.payment_order.generate_payment_file() + self.payment_order.generated2uploaded() + self.assertEqual(self.payment_order.state, "uploaded") diff --git a/setup/account_banking_ach_credit_transfer/odoo/addons/account_banking_ach_credit_transfer b/setup/account_banking_ach_credit_transfer/odoo/addons/account_banking_ach_credit_transfer new file mode 120000 index 00000000..25eb2ea9 --- /dev/null +++ b/setup/account_banking_ach_credit_transfer/odoo/addons/account_banking_ach_credit_transfer @@ -0,0 +1 @@ +../../../../account_banking_ach_credit_transfer \ No newline at end of file diff --git a/setup/account_banking_ach_credit_transfer/setup.py b/setup/account_banking_ach_credit_transfer/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/account_banking_ach_credit_transfer/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)