-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
JordiMForgeFlow
wants to merge
22
commits into
OCA:17.0
Choose a base branch
from
ForgeFlow:17.0-mig-account_banking_ach_base
base: 17.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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 dc2d063
[IMP] account_banking_ach_base: Improved code.
murtuzasaleh 665649f
[UPD] Update account_banking_ach_base.pot
oca-travis 31631cb
[ADD] icon.png
OCA-git-bot d6a8b91
[UPD] README.rst
OCA-git-bot 9c7e438
[FIX] Travis
Chanakya-SerpentCS 86058c4
[13.0][MIG] account_banking_ach_base
Chanakya-SerpentCS 551c82a
[ADD] account_banking_ach_base Module.
Murtaza-OSI a7dc41b
[IMP] Code After pre-commit.
Murtaza-OSI 3a557f6
[IMP] Removed Legal Number field from Partner
Chanakya-SerpentCS 1f7a139
[FIX] Fixed Travis
Chanakya-SerpentCS b4e8a9a
[REN] l10n_us_partner_legal_number
max3903 695bc9b
[FIX] account_banking_ach_base
max3903 948cbb8
Update account_banking_ach_base/__manifest__.py
max3903 f03a634
[UPD] Update account_banking_ach_base.pot
oca-travis e74b713
[UPD] README.rst
OCA-git-bot 91f0ff5
[Fix] ACH file invalid characters sent - Removed special characters e…
Vijaiy-Selvaraj 4261354
account_banking_ach_base 14.0.1.0.1
OCA-git-bot 1857a6c
[16.0][MIG] account_banking_ach_base
Hardik-OSI 5d5c8ec
[FIX] account_banking_ach_base: run pre-commit
JordiBForgeFlow 5050cf4
[IMP] account_banking_ach_base: pre-commit fixes
JordiMForgeFlow 3419f48
[MIG] account_banking_ach_base: migration to V17
JordiMForgeFlow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
194
account_banking_ach_base/i18n/account_banking_ach_base.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
63
account_banking_ach_base/models/account_banking_mandate.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( | ||
_("""Delay days must be specified, and greater than 0.""") | ||
) | ||
return super().validate() | ||
|
||
def set_payment_modes_on_partner(self): | ||
""" | ||
Set the payment modes on the Partner if they don't already exist. | ||
""" | ||
payment_modes = {} | ||
if ( | ||
self.partner_id.customer_rank | ||
and not self.partner_id.customer_payment_mode_id | ||
): | ||
customer_mode = self.env["account.payment.mode"].search( | ||
[ | ||
("payment_type", "=", "inbound"), | ||
("company_id", "=", self.company_id.id), | ||
], | ||
limit=1, | ||
) | ||
if customer_mode: | ||
payment_modes["customer_payment_mode_id"] = customer_mode.id | ||
if ( | ||
self.partner_id.supplier_rank | ||
and not self.partner_id.supplier_payment_mode_id | ||
): | ||
supplier_mode = self.env["account.payment.mode"].search( | ||
[ | ||
("payment_type", "=", "outbound"), | ||
("company_id", "=", self.company_id.id), | ||
], | ||
limit=1, | ||
) | ||
if supplier_mode: | ||
payment_modes["supplier_payment_mode_id"] = supplier_mode.id | ||
if payment_modes: | ||
self.partner_id.write(payment_modes) | ||
|
||
@api.model_create_multi | ||
def create(self, vals_list): | ||
mandates = super().create(vals_list) | ||
for mandate in mandates: | ||
mandate.set_payment_modes_on_partner() | ||
return mandates | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better if you adapt
set_payment_modes_on_partner()
to api.multi, as it is doingsearch
andwrite
inside.