-
-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] account_statement_import_online_gocardless
This module provides online bank statements from GoCardless Bank Account Data, which provides a free API for connecting and getting transactions for bank accounts. TT45760
- Loading branch information
1 parent
c821648
commit baa7f80
Showing
25 changed files
with
1,685 additions
and
0 deletions.
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,145 @@ | ||
================================== | ||
Online Bank Statements: GoCardless | ||
================================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:5523e4b06eaa38f0f74b6181f2043b93037f673d8a5038474c13dc323f1492ac | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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%2Fbank--statement--import-lightgray.png?logo=github | ||
:target: https://github.com/OCA/bank-statement-import/tree/15.0/account_statement_import_online_gocardless | ||
:alt: OCA/bank-statement-import | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/bank-statement-import-15-0/bank-statement-import-15-0-account_statement_import_online_gocardless | ||
: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/bank-statement-import&target_branch=15.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module provides online bank statements from GoCardless Bank Account Data, | ||
which provides a free API for connecting and getting transactions for bank | ||
accounts. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
On the GoCardless website | ||
~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
#. Go to https://bankaccountdata.gocardless.com, and create or login into your | ||
"GoCardLess Bank Account Data" account. | ||
#. Go to Developers > User secrets option on the left. | ||
#. Click on the "+ Create new" button on the bottom part. | ||
#. Put a name to the user secret (eg. Odoo), and optionally limit it to certain | ||
IPs using CIDR subnet notation. | ||
#. Copy or download the secret ID and key for later use. The second one won't be | ||
available anymore, so make sure you don't forget this step. | ||
|
||
On Odoo | ||
~~~~~~~ | ||
|
||
To configure online bank statements provider: | ||
|
||
#. Add your user to the "Full Accounting Settings" group. | ||
#. Go to *Invoicing > Configuration > Accounting > Journals*. | ||
#. Select the journal representing your bank account (or create it). | ||
#. The bank account number should be properly introduced. | ||
#. Set *Bank Feeds* to *Online (OCA)*. | ||
#. Select *GoCardless* as online bank statements provider in | ||
*Online Bank Statements (OCA)* section. | ||
#. Save the journal | ||
#. Click on the created provider. | ||
#. Put your secret ID and secret key on the existing fields. | ||
#. Click on the button "Select Bank Account Identifier". | ||
|
||
.. image:: https://raw.githubusercontent.com/OCA/bank-statement-import/15.0/account_statement_import_online_gocardless/static/img/gocardless_configuration.gif | ||
|
||
#. A new window will appear for selecting the bank entity. | ||
|
||
.. image:: https://raw.githubusercontent.com/OCA/bank-statement-import/15.0/account_statement_import_online_gocardless/static/img/gocardless_bank_selection.gif | ||
|
||
#. Select it, and you will be redirected to the selected entity for introducing | ||
your bank credentials to allow the connection. | ||
#. If the process is completed, and the bank account linked to the journal is | ||
accessible, you'll be again redirected to the online provider form, and | ||
everything will be linked and ready to start the transaction pulling. A | ||
message is logged about it on the chatter. | ||
#. If not, an error message will be logged either in the chatter. | ||
|
||
Usage | ||
===== | ||
|
||
To pull historical bank statements: | ||
|
||
#. Go to *Invoicing > Configuration > Accounting > Journals*. | ||
#. Select the journal representing your bank account. | ||
#. Launch *Actions > Online Bank Statements Pull Wizard* | ||
#. Configure date interval and click on *Pull*. | ||
|
||
If historical data is not needed, then just simply wait for the scheduled | ||
activity "Pull Online Bank Statements" to be executed for getting new | ||
transactions. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/bank-statement-import/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/bank-statement-import/issues/new?body=module:%20account_statement_import_online_gocardless%0Aversion:%2015.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 | ||
~~~~~~~ | ||
|
||
* ForgeFlow | ||
* Tecnativa | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* `ForgeFlow <https://www.forgeflow.com>`__: | ||
|
||
* Christopher Ormaza | ||
* Jordi Ballester | ||
* `Tecnativa <https://www.tecnativa.com>`__: | ||
|
||
* Pedro M. Baeza | ||
|
||
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/bank-statement-import <https://github.com/OCA/bank-statement-import/tree/15.0/account_statement_import_online_gocardless>`_ 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,4 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import models | ||
from . import controllers |
30 changes: 30 additions & 0 deletions
30
account_statement_import_online_gocardless/__manifest__.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,30 @@ | ||
# Copyright 2022 ForgeFlow S.L. | ||
# Copyright 2023 Tecnativa - Pedro M. Baeza | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
{ | ||
"name": "Online Bank Statements: GoCardless", | ||
"version": "15.0.1.0.0", | ||
"category": "Account", | ||
"website": "https://github.com/OCA/bank-statement-import", | ||
"author": "ForgeFlow, Tecnativa, Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"installable": True, | ||
"depends": [ | ||
"account_statement_import_online", | ||
], | ||
"data": ["view/online_bank_statement_provider.xml"], | ||
"assets": { | ||
"web.assets_backend": [ | ||
"account_statement_import_online_gocardless/static/src/" | ||
"lib/gocardless-ui/selector.css", | ||
"account_statement_import_online_gocardless/static/src/" | ||
"lib/gocardless-ui/selector.js", | ||
"account_statement_import_online_gocardless/static/src/" | ||
"js/select_bank_widget.js", | ||
], | ||
"web.assets_qweb": [ | ||
"account_statement_import_online_gocardless/static/src/xml" | ||
"/select_bank_widget.xml" | ||
], | ||
}, | ||
} |
1 change: 1 addition & 0 deletions
1
account_statement_import_online_gocardless/controllers/__init__.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 @@ | ||
from . import main |
35 changes: 35 additions & 0 deletions
35
account_statement_import_online_gocardless/controllers/main.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,35 @@ | ||
# Copyright 2022 ForgeFlow S.L. | ||
# Copyright 2023 Tecnativa - Pedro M. Baeza | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
import werkzeug | ||
from werkzeug.urls import url_encode | ||
|
||
from odoo import http | ||
from odoo.http import request | ||
|
||
|
||
class GocardlessController(http.Controller): | ||
@http.route("/gocardless/response", type="http", auth="public", csrf=False) | ||
def gocardless_response(self, **post): | ||
Provider = request.env["online.bank.statement.provider"].sudo() | ||
current_provider = Provider.search( | ||
[("gocardless_requisition_ref", "=", post["ref"])] | ||
) | ||
params = { | ||
"action": request.env.ref( | ||
"account_statement_import_online.online_bank_statement_provider_action" | ||
).id, | ||
"model": "online.bank.statement.provider", | ||
} | ||
if current_provider: | ||
current_provider._gocardless_finish_requisition() | ||
params.update( | ||
{ | ||
"view_type": "form", | ||
"id": current_provider.id, | ||
} | ||
) | ||
else: | ||
params["view_type"] = "list" | ||
return werkzeug.utils.redirect("/web#" + url_encode(params), 303) | ||
3 changes: 3 additions & 0 deletions
3
account_statement_import_online_gocardless/models/__init__.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,3 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import online_bank_statement_provider |
Oops, something went wrong.