diff --git a/account_banking_ach_direct_debit/README.rst b/account_banking_ach_direct_debit/README.rst index e8f71af6..d5028902 100644 --- a/account_banking_ach_direct_debit/README.rst +++ b/account_banking_ach_direct_debit/README.rst @@ -14,13 +14,13 @@ Account Banking ACH Direct Debit :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/14.0/account_banking_ach_direct_debit + :target: https://github.com/OCA/l10n-usa/tree/16.0/account_banking_ach_direct_debit :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-14-0/l10n-usa-14-0-account_banking_ach_direct_debit + :target: https://translation.odoo-community.org/projects/l10n-usa-16-0/l10n-usa-16-0-account_banking_ach_direct_debit :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/203/14.0 + :target: https://runbot.odoo-community.org/runbot/203/16.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -69,7 +69,7 @@ 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 smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -102,6 +102,6 @@ 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. +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_direct_debit/__init__.py b/account_banking_ach_direct_debit/__init__.py index f1a6eca6..83e553ac 100644 --- a/account_banking_ach_direct_debit/__init__.py +++ b/account_banking_ach_direct_debit/__init__.py @@ -1,4 +1,3 @@ # 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_direct_debit/__manifest__.py b/account_banking_ach_direct_debit/__manifest__.py index f6c04cf0..057b1f9b 100644 --- a/account_banking_ach_direct_debit/__manifest__.py +++ b/account_banking_ach_direct_debit/__manifest__.py @@ -19,6 +19,5 @@ "views/account_banking_mandate_view.xml", ], "demo": ["demo/ach_direct_debit_demo.xml"], - "post_init_hook": "update_bank_journals", "installable": True, } diff --git a/account_banking_ach_direct_debit/models/account_payment_order.py b/account_banking_ach_direct_debit/models/account_payment_order.py index 6ffee9a9..1b104b43 100644 --- a/account_banking_ach_direct_debit/models/account_payment_order.py +++ b/account_banking_ach_direct_debit/models/account_payment_order.py @@ -30,18 +30,18 @@ def generated2uploaded(self): mandate = self.env["account.banking.mandate"] for order in self: to_expire_mandates = first_mandates = all_mandates = mandate - for bank_line in order.bank_line_ids: - if bank_line.mandate_id in all_mandates: + for payment in order.payment_ids: + if payment.mandate_id in all_mandates: continue - all_mandates += bank_line.mandate_id - if bank_line.mandate_id.type == "oneoff": - to_expire_mandates += bank_line.mandate_id - elif bank_line.mandate_id.type == "recurrent": - seq_type = bank_line.mandate_id.recurrent_sequence_type + all_mandates += payment.mandate_id + if payment.mandate_id.type == "oneoff": + to_expire_mandates += payment.mandate_id + elif payment.mandate_id.type == "recurrent": + seq_type = payment.mandate_id.recurrent_sequence_type if seq_type == "final": - to_expire_mandates += bank_line.mandate_id + to_expire_mandates += payment.mandate_id elif seq_type == "first": - first_mandates += bank_line.mandate_id + first_mandates += payment.mandate_id all_mandates.write({"last_debit_date": order.date_generated}) to_expire_mandates.write({"state": "expired"}) first_mandates.write({"recurrent_sequence_type": "recurring"}) diff --git a/account_banking_ach_direct_debit/post_install.py b/account_banking_ach_direct_debit/post_install.py deleted file mode 100644 index 6a12e5a1..00000000 --- a/account_banking_ach_direct_debit/post_install.py +++ /dev/null @@ -1,16 +0,0 @@ -# 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): - with api.Environment.manage(): - env = api.Environment(cr, SUPERUSER_ID, {}) - journals = env["account.journal"].search([("type", "=", "bank")]) - ach_dd = env.ref( - "account_banking_ach_direct_debit.ach_direct_debit", - raise_if_not_found=False, - ) - if ach_dd: - journals.write({"inbound_payment_method_ids": [(4, ach_dd.id)]}) - return diff --git a/account_banking_ach_direct_debit/static/description/index.html b/account_banking_ach_direct_debit/static/description/index.html index 22c3e63a..4ae2f7ac 100644 --- a/account_banking_ach_direct_debit/static/description/index.html +++ b/account_banking_ach_direct_debit/static/description/index.html @@ -3,7 +3,7 @@ - + Account Banking ACH Direct Debit