-
-
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
[16.0][mig] account_banking_ach_base #128
base: 16.0
Are you sure you want to change the base?
Changes from all commits
34ba366
5c84184
0c4d98f
6307087
1532a98
329f6f7
8af817d
af7cc70
c6660ea
7a96dc9
e44945d
512f6a0
52bb230
2ee0a14
c39fbc0
0379d77
ef9cc03
8e6181c
35258f9
df06297
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
===================================================== | ||
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/16.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-16-0/l10n-usa-16-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=16.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:%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. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
~~~~~~~ | ||
|
||
* Thinkwell Designs | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Dave Burkholder <dave@thinkwelldesigns.com> | ||
* Maxime Chambreuil <mchambreuil@opensourceintegrators.com> | ||
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com> | ||
* Murtaza Mithaiwala <mmithaiwala@opensourceintegrators.com> | ||
|
||
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/16.0/account_banking_ach_base>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright 2018 Thinkwell Designs <dave@thinkwelldesigns.com> | ||
# 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": "16.0.1.0.1", | ||
"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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. idem |
||
"l10n_us_partner_legal_number", | ||
], | ||
"data": [ | ||
"views/account_banking_mandate.xml", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to Odoo's guidelines which are the base for ours this file's name should be suffixed with "_views". The renaming should be done with "git move" command. |
||
"views/account_move.xml", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. idem |
||
"views/res_bank.xml", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. idem |
||
"views/res_company.xml", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. idem |
||
], | ||
"external_dependencies": {"python": ["python-stdnum", "ach"]}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OCA's Contributing guidelines suggest put installation instructions for these as part of the INSTALLATION section of README |
||
"installable": True, | ||
} |
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 "" |
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 |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,62 @@ | ||||||||
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(AccountBankingMandate, self).validate() | ||||||||
|
||||||||
def set_payment_modes_on_partner(self): | ||||||||
""" | ||||||||
Set the payment modes on the Partner if they don't already exist. | ||||||||
""" | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
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 | ||||||||
def create(self, vals): | ||||||||
mandate = super(AccountBankingMandate, self).create(vals) | ||||||||
mandate.set_payment_modes_on_partner() | ||||||||
return mandate | ||||||||
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.
Since it's a dependency in another oca repository I'll suggest the use of oca_dependencies.txt