Skip to content

Commit

Permalink
[16.0][MIG] account_banking_ach_direct_debit
Browse files Browse the repository at this point in the history
[FIX] account_banking_ach_direct_debit: use the payment_ids field instead of bank_line_ids

Apply same fix as #101
  • Loading branch information
Murtaza-OSI authored and patrickrwilson committed Apr 14, 2023
1 parent 402ceb0 commit 894c880
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 36 deletions.
10 changes: 5 additions & 5 deletions account_banking_ach_direct_debit/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down Expand Up @@ -69,7 +69,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-usa/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 <https://github.com/OCA/l10n-usa/issues/new?body=module:%20account_banking_ach_direct_debit%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/l10n-usa/issues/new?body=module:%20account_banking_ach_direct_debit%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Expand Down Expand Up @@ -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 <https://github.com/OCA/l10n-usa/tree/14.0/account_banking_ach_direct_debit>`_ project on GitHub.
This module is part of the `OCA/l10n-usa <https://github.com/OCA/l10n-usa/tree/16.0/account_banking_ach_direct_debit>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 0 additions & 1 deletion account_banking_ach_direct_debit/__init__.py
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion account_banking_ach_direct_debit/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
18 changes: 9 additions & 9 deletions account_banking_ach_direct_debit/models/account_payment_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand Down
16 changes: 0 additions & 16 deletions account_banking_ach_direct_debit/post_install.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Account Banking ACH Direct Debit</title>
<style type="text/css">

Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Account Banking ACH Direct Debit</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-usa/tree/14.0/account_banking_ach_direct_debit"><img alt="OCA/l10n-usa" src="https://img.shields.io/badge/github-OCA%2Fl10n--usa-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-usa-14-0/l10n-usa-14-0-account_banking_ach_direct_debit"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/203/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-usa/tree/16.0/account_banking_ach_direct_debit"><img alt="OCA/l10n-usa" src="https://img.shields.io/badge/github-OCA%2Fl10n--usa-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-usa-16-0/l10n-usa-16-0-account_banking_ach_direct_debit"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/203/16.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>Create ACH files for Direct Debit</p>
<p>Module to export direct debit payment orders in Nacha file format.</p>
<p><strong>Table of contents</strong></p>
Expand Down Expand Up @@ -418,7 +418,7 @@ <h1><a class="toc-backref" href="#id4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-usa/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/l10n-usa/issues/new?body=module:%20account_banking_ach_direct_debit%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/l10n-usa/issues/new?body=module:%20account_banking_ach_direct_debit%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -445,7 +445,7 @@ <h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-usa/tree/14.0/account_banking_ach_direct_debit">OCA/l10n-usa</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-usa/tree/16.0/account_banking_ach_direct_debit">OCA/l10n-usa</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down

0 comments on commit 894c880

Please sign in to comment.