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

[17.0][MIG] account_banking_ach_base #137

Open
wants to merge 22 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0943a27
[ADD] account_banking_ach_base
max3903 Jul 1, 2019
dc2d063
[IMP] account_banking_ach_base: Improved code.
murtuzasaleh Jul 4, 2019
665649f
[UPD] Update account_banking_ach_base.pot
oca-travis Jul 5, 2019
31631cb
[ADD] icon.png
OCA-git-bot Jul 5, 2019
d6a8b91
[UPD] README.rst
OCA-git-bot Jul 29, 2019
9c7e438
[FIX] Travis
Chanakya-SerpentCS Dec 10, 2020
86058c4
[13.0][MIG] account_banking_ach_base
Chanakya-SerpentCS Dec 10, 2020
551c82a
[ADD] account_banking_ach_base Module.
Murtaza-OSI Jan 28, 2021
a7dc41b
[IMP] Code After pre-commit.
Murtaza-OSI Jan 28, 2021
3a557f6
[IMP] Removed Legal Number field from Partner
Chanakya-SerpentCS Mar 2, 2021
1f7a139
[FIX] Fixed Travis
Chanakya-SerpentCS Mar 2, 2021
b4e8a9a
[REN] l10n_us_partner_legal_number
max3903 Mar 2, 2021
695bc9b
[FIX] account_banking_ach_base
max3903 Mar 5, 2021
948cbb8
Update account_banking_ach_base/__manifest__.py
max3903 Mar 7, 2021
f03a634
[UPD] Update account_banking_ach_base.pot
oca-travis Jun 22, 2021
e74b713
[UPD] README.rst
OCA-git-bot Jun 22, 2021
91f0ff5
[Fix] ACH file invalid characters sent - Removed special characters e…
Vijaiy-Selvaraj Sep 9, 2021
4261354
account_banking_ach_base 14.0.1.0.1
OCA-git-bot Nov 15, 2022
1857a6c
[16.0][MIG] account_banking_ach_base
Hardik-OSI Dec 19, 2022
5d5c8ec
[FIX] account_banking_ach_base: run pre-commit
JordiBForgeFlow Jun 18, 2024
5050cf4
[IMP] account_banking_ach_base: pre-commit fixes
JordiMForgeFlow Nov 21, 2024
3419f48
[MIG] account_banking_ach_base: migration to V17
JordiMForgeFlow Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions account_banking_ach_base/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
=====================================================
Localizations for North American Banking & Financials
=====================================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3e433c1cd98ea8f71c47602d76dc289df93b16fc3d56487bff66d2455e5d2c6a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/17.0/account_banking_ach_base
: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-17-0/l10n-usa-17-0-account_banking_ach_base
: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=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Add fields to Bank, Partner and Company required for ACH transactions in
USA.

**Table of contents**

.. contents::
:local:

Usage
=====

Add routing_number on Bank records.

Add Legal ID on Partner and Company records.

Add Mandate URL field to Company record. Use in email templates to
provide customer with an easy way to access your Mandate Authorization
form to streamline ACH authorizations.

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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-usa/issues/new?body=module:%20account_banking_ach_base%0Aversion:%2017.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.

Credits
=======

Authors
-------

* Thinkwell Designs

Contributors
------------

- Dave Burkholder <[email protected]>
- Maxime Chambreuil <[email protected]>
- Serpent Consulting Services Pvt. Ltd. <[email protected]>
- Murtaza Mithaiwala <[email protected]>

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 <https://github.com/OCA/l10n-usa/tree/17.0/account_banking_ach_base>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions account_banking_ach_base/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
25 changes: 25 additions & 0 deletions account_banking_ach_base/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2018 Thinkwell Designs <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Localizations for North American Banking & Financials",
"summary": "Add fields required for North American Banking & Financials",
"version": "17.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_payment_order",
"account_banking_mandate",
"l10n_us_partner_legal_number",
],
"data": [
"views/account_banking_mandate.xml",
"views/account_move.xml",
"views/res_bank.xml",
"views/res_company.xml",
],
"external_dependencies": {"python": ["python-stdnum", "ach"]},
"installable": True,
}
194 changes: 194 additions & 0 deletions account_banking_ach_base/i18n/account_banking_ach_base.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_banking_ach_base
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.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_base
#: code:addons/account_banking_ach_base/models/account_payment_order.py:0
#, python-format
msgid "%s account number has no Bank assigned"
msgstr ""

#. module: account_banking_ach_base
#: code:addons/account_banking_ach_base/models/account_payment_order.py:0
#, python-format
msgid "%s does not have a Routing Number assigned!"
msgstr ""

#. module: account_banking_ach_base
#: code:addons/account_banking_ach_base/models/account_payment_order.py:0
#, python-format
msgid "%s does not have an EIN / SSN / BN assigned!"
msgstr ""

#. module: account_banking_ach_base
#: code:addons/account_banking_ach_base/models/account_payment_order.py:0
#, python-format
msgid "%s has no routing number specified"
msgstr ""

#. module: account_banking_ach_base
#: code:addons/account_banking_ach_base/models/res_bank.py:0
#, python-format
msgid "%s is not a valid Canadian routing number!"
msgstr ""

#. module: account_banking_ach_base
#: code:addons/account_banking_ach_base/models/res_bank.py:0
#, python-format
msgid "%s is not a valid US routing number!"
msgstr ""

#. module: account_banking_ach_base
#: model:ir.model,name:account_banking_ach_base.model_account_banking_mandate
msgid "A generic banking mandate"
msgstr ""

#. module: account_banking_ach_base
#: model:ir.model,name:account_banking_ach_base.model_res_bank
msgid "Bank"
msgstr ""

#. module: account_banking_ach_base
#: model:ir.model,name:account_banking_ach_base.model_res_company
msgid "Companies"
msgstr ""

#. module: account_banking_ach_base
#: model:ir.model.fields,field_description:account_banking_ach_base.field_account_banking_mandate__delay_days
msgid "Delay Days"
msgstr ""

#. module: account_banking_ach_base
#: code:addons/account_banking_ach_base/models/account_banking_mandate.py:0
#, python-format
msgid "Delay days must be specified, and greater than 0."
msgstr ""

#. module: account_banking_ach_base
#: model:ir.model.fields,field_description:account_banking_ach_base.field_account_banking_mandate__display_name
#: model:ir.model.fields,field_description:account_banking_ach_base.field_account_move__display_name
#: model:ir.model.fields,field_description:account_banking_ach_base.field_account_payment_order__display_name
#: model:ir.model.fields,field_description:account_banking_ach_base.field_res_bank__display_name
#: model:ir.model.fields,field_description:account_banking_ach_base.field_res_company__display_name
msgid "Display Name"
msgstr ""

#. module: account_banking_ach_base
#: model_terms:ir.ui.view,arch_db:account_banking_ach_base.view_company_legal_id_number
msgid "EIN / SSN / BN"
msgstr ""

#. module: account_banking_ach_base
#: model:ir.model.fields,help:account_banking_ach_base.field_res_company__legal_id_number
msgid ""
"For US entities, enter valid EIN or Social Security Number.\n"
" Canadian entities, enter Canadian Business Number.\n"
" "
msgstr ""

#. module: account_banking_ach_base
#: model:ir.model.fields,help:account_banking_ach_base.field_res_company__mandate_url
msgid ""
"Full URL to download ACH Mandate /\n"
" Authorization form. Useful to include in email\n"
" templates for customer to access and\n"
" complete the Mandate form."
msgstr ""

#. module: account_banking_ach_base
#: model:ir.model.fields,field_description:account_banking_ach_base.field_account_banking_mandate__id
#: model:ir.model.fields,field_description:account_banking_ach_base.field_account_move__id
#: model:ir.model.fields,field_description:account_banking_ach_base.field_account_payment_order__id
#: model:ir.model.fields,field_description:account_banking_ach_base.field_res_bank__id
#: model:ir.model.fields,field_description:account_banking_ach_base.field_res_company__id
msgid "ID"
msgstr ""

#. module: account_banking_ach_base
#: model:ir.model,name:account_banking_ach_base.model_account_move
msgid "Journal Entry"
msgstr ""

#. module: account_banking_ach_base
#: model:ir.model.fields,field_description:account_banking_ach_base.field_account_banking_mandate____last_update
#: model:ir.model.fields,field_description:account_banking_ach_base.field_account_move____last_update
#: model:ir.model.fields,field_description:account_banking_ach_base.field_account_payment_order____last_update
#: model:ir.model.fields,field_description:account_banking_ach_base.field_res_bank____last_update
#: model:ir.model.fields,field_description:account_banking_ach_base.field_res_company____last_update
msgid "Last Modified on"
msgstr ""

#. module: account_banking_ach_base
#: model:ir.model.fields,field_description:account_banking_ach_base.field_res_company__legal_id_number
msgid "Legal ID"
msgstr ""

#. module: account_banking_ach_base
#: model:ir.model.fields,field_description:account_banking_ach_base.field_res_company__mandate_url
msgid "Mandate URL"
msgstr ""

#. module: account_banking_ach_base
#: code:addons/account_banking_ach_base/models/account_payment_order.py:0
#, python-format
msgid ""
"Missing ACH Direct Debit mandate on the bank payment line with partner '%s' "
"(reference '%s')."
msgstr ""

#. module: account_banking_ach_base
#: model:ir.model.fields,help:account_banking_ach_base.field_account_banking_mandate__delay_days
msgid ""
"Number of days to wait after invoice\n"
" date before including an invoice in Payment\n"
" Order for processing."
msgstr ""

#. module: account_banking_ach_base
#: model:ir.model,name:account_banking_ach_base.model_account_payment_order
msgid "Payment Order"
msgstr ""

#. module: account_banking_ach_base
#: model_terms:ir.ui.view,arch_db:account_banking_ach_base.view_account_invoice_filter_valid_mandate_id
msgid "Ready for Payment Order"
msgstr ""

#. module: account_banking_ach_base
#: model:ir.model.fields,field_description:account_banking_ach_base.field_res_bank__routing_number
msgid "Routing Number"
msgstr ""

#. module: account_banking_ach_base
#: code:addons/account_banking_ach_base/models/account_payment_order.py:0
#, python-format
msgid ""
"The ACH Direct Debit mandate with reference '%s' for partner '%s' has "
"expired."
msgstr ""

#. module: account_banking_ach_base
#: code:addons/account_banking_ach_base/models/account_payment_order.py:0
#, python-format
msgid ""
"The mandate with reference '%s' for partner '%s' has type set to 'One-Off' "
"and it has a last debit date set to '%s', so we can't use it."
msgstr ""

#. module: account_banking_ach_base
#: code:addons/account_banking_ach_base/models/account_move.py:0
#, python-format
msgid ""
"To satisfy payment mandate, cannot add invoice %s to Debit Order until %s!"
msgstr ""
8 changes: 8 additions & 0 deletions account_banking_ach_base/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import account_banking_mandate
from . import account_move
from . import account_payment_order
from . import res_bank
from . import res_company
from . import account_payment_method
63 changes: 63 additions & 0 deletions account_banking_ach_base/models/account_banking_mandate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
from odoo import _, api, fields, models
from odoo.exceptions import UserError


class AccountBankingMandate(models.Model):
_inherit = "account.banking.mandate"

delay_days = fields.Integer(
required=True,
default=10,
help="""Number of days to wait after invoice
date before including an invoice in Payment
Order for processing.""",
)

def validate(self):
for mandate in self:
if not mandate.delay_days:
raise UserError(

Check warning on line 19 in account_banking_ach_base/models/account_banking_mandate.py

View check run for this annotation

Codecov / codecov/patch

account_banking_ach_base/models/account_banking_mandate.py#L19

Added line #L19 was not covered by tests
_("""Delay days must be specified, and greater than 0.""")
)
return super().validate()

Check warning on line 22 in account_banking_ach_base/models/account_banking_mandate.py

View check run for this annotation

Codecov / codecov/patch

account_banking_ach_base/models/account_banking_mandate.py#L22

Added line #L22 was not covered by tests

def set_payment_modes_on_partner(self):
"""
Set the payment modes on the Partner if they don't already exist.
"""
payment_modes = {}

Check warning on line 28 in account_banking_ach_base/models/account_banking_mandate.py

View check run for this annotation

Codecov / codecov/patch

account_banking_ach_base/models/account_banking_mandate.py#L28

Added line #L28 was not covered by tests
if (
self.partner_id.customer_rank
and not self.partner_id.customer_payment_mode_id
):
customer_mode = self.env["account.payment.mode"].search(

Check warning on line 33 in account_banking_ach_base/models/account_banking_mandate.py

View check run for this annotation

Codecov / codecov/patch

account_banking_ach_base/models/account_banking_mandate.py#L33

Added line #L33 was not covered by tests
[
("payment_type", "=", "inbound"),
("company_id", "=", self.company_id.id),
],
limit=1,
)
if customer_mode:
payment_modes["customer_payment_mode_id"] = customer_mode.id

Check warning on line 41 in account_banking_ach_base/models/account_banking_mandate.py

View check run for this annotation

Codecov / codecov/patch

account_banking_ach_base/models/account_banking_mandate.py#L41

Added line #L41 was not covered by tests
if (
self.partner_id.supplier_rank
and not self.partner_id.supplier_payment_mode_id
):
supplier_mode = self.env["account.payment.mode"].search(

Check warning on line 46 in account_banking_ach_base/models/account_banking_mandate.py

View check run for this annotation

Codecov / codecov/patch

account_banking_ach_base/models/account_banking_mandate.py#L46

Added line #L46 was not covered by tests
[
("payment_type", "=", "outbound"),
("company_id", "=", self.company_id.id),
],
limit=1,
)
if supplier_mode:
payment_modes["supplier_payment_mode_id"] = supplier_mode.id

Check warning on line 54 in account_banking_ach_base/models/account_banking_mandate.py

View check run for this annotation

Codecov / codecov/patch

account_banking_ach_base/models/account_banking_mandate.py#L54

Added line #L54 was not covered by tests
if payment_modes:
self.partner_id.write(payment_modes)

Check warning on line 56 in account_banking_ach_base/models/account_banking_mandate.py

View check run for this annotation

Codecov / codecov/patch

account_banking_ach_base/models/account_banking_mandate.py#L56

Added line #L56 was not covered by tests

@api.model_create_multi
def create(self, vals_list):
mandates = super().create(vals_list)

Check warning on line 60 in account_banking_ach_base/models/account_banking_mandate.py

View check run for this annotation

Codecov / codecov/patch

account_banking_ach_base/models/account_banking_mandate.py#L60

Added line #L60 was not covered by tests
for mandate in mandates:
mandate.set_payment_modes_on_partner()
Comment on lines +61 to +62
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for mandate in mandates:
mandate.set_payment_modes_on_partner()
mandates.set_payment_modes_on_partner()

It would be better if you adapt set_payment_modes_on_partner() to api.multi, as it is doing search and write inside.

return mandates

Check warning on line 63 in account_banking_ach_base/models/account_banking_mandate.py

View check run for this annotation

Codecov / codecov/patch

account_banking_ach_base/models/account_banking_mandate.py#L62-L63

Added lines #L62 - L63 were not covered by tests
Loading
Loading