Skip to content

Commit

Permalink
Merge pull request #610 from OCA/16.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/bank-statement-import (16.0)
  • Loading branch information
bt-admin authored Feb 25, 2025
2 parents dbfbf2c + 610de5e commit 94b237b
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ addon | version | maintainers | summary
[account_statement_import_file](account_statement_import_file/) | 16.0.1.1.0 | [![alexis-via](https://github.com/alexis-via.png?size=30px)](https://github.com/alexis-via) [![etobella](https://github.com/etobella.png?size=30px)](https://github.com/etobella) | Import Statement Files
[account_statement_import_file_reconcile_oca](account_statement_import_file_reconcile_oca/) | 16.0.1.0.0 | [![alexis-via](https://github.com/alexis-via.png?size=30px)](https://github.com/alexis-via) | Import Statement Files and Go Direct to Reconciliation
[account_statement_import_ofx](account_statement_import_ofx/) | 16.0.1.0.0 | [![alexis-via](https://github.com/alexis-via.png?size=30px)](https://github.com/alexis-via) | Import OFX Bank Statement
[account_statement_import_online](account_statement_import_online/) | 16.0.1.4.0 | [![alexey-pelykh](https://github.com/alexey-pelykh.png?size=30px)](https://github.com/alexey-pelykh) | Online bank statements update
[account_statement_import_online_gocardless](account_statement_import_online_gocardless/) | 16.0.1.2.4 | | Online Bank Statements: GoCardless
[account_statement_import_online](account_statement_import_online/) | 16.0.1.4.1 | [![alexey-pelykh](https://github.com/alexey-pelykh.png?size=30px)](https://github.com/alexey-pelykh) | Online bank statements update
[account_statement_import_online_gocardless](account_statement_import_online_gocardless/) | 16.0.1.2.6 | | Online Bank Statements: GoCardless
[account_statement_import_online_ofx](account_statement_import_online_ofx/) | 16.0.1.0.0 | | Online bank statements for OFX
[account_statement_import_online_paypal](account_statement_import_online_paypal/) | 16.0.1.0.2 | [![alexey-pelykh](https://github.com/alexey-pelykh.png?size=30px)](https://github.com/alexey-pelykh) | Online bank statements for PayPal.com
[account_statement_import_online_ponto](account_statement_import_online_ponto/) | 16.0.1.1.1 | | Online Bank Statements: MyPonto.com
Expand Down
2 changes: 1 addition & 1 deletion account_statement_import_online/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Online Bank Statements
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7c346ba8c3ec06e4ee482f0e38fd478607e2ad2aa8ce2259d20a4329b047f880
!! source digest: sha256:72969b42e8553bde092ce2e996bfa3336e6ff1bd5c02441d46c0ccf8293327d2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion account_statement_import_online/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{
"name": "Online Bank Statements",
"version": "16.0.1.4.0",
"version": "16.0.1.4.1",
"author": "CorporateHub, Odoo Community Association (OCA)",
"maintainers": ["alexey-pelykh"],
"website": "https://github.com/OCA/bank-statement-import",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Online Bank Statements</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7c346ba8c3ec06e4ee482f0e38fd478607e2ad2aa8ce2259d20a4329b047f880
!! source digest: sha256:72969b42e8553bde092ce2e996bfa3336e6ff1bd5c02441d46c0ccf8293327d2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/bank-statement-import/tree/16.0/account_statement_import_online"><img alt="OCA/bank-statement-import" src="https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_online"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/bank-statement-import&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module provides base for building online bank statements providers.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from odoo_test_helper import FakeModelLoader

from odoo import _, fields
from odoo.tests import common
from odoo.tests import common, tagged

_logger = logging.getLogger(__name__)

Expand All @@ -22,11 +22,20 @@
)


@tagged("post_install", "-at_install")
class TestAccountBankAccountStatementImportOnline(common.TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()

if not cls.env.company.chart_template_id:
# Load a CoA if there's none in current company
coa = cls.env.ref("l10n_generic_coa.configurable_chart_template", False)
if not coa:
# Load the first available CoA
coa = cls.env["account.chart.template"].search(
[("visible", "=", True)], limit=1
)
coa.try_loading(company=cls.env.company, install_demo=False)
# Load fake model
cls.loader = FakeModelLoader(cls.env, cls.__module__)
cls.loader.backup_registry()
Expand Down
2 changes: 1 addition & 1 deletion account_statement_import_online_gocardless/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Online Bank Statements: GoCardless
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:86c3a6944d510b258d44f2a74e4e9e433cb0e4f9745ca156414b7a5c0d83efb1
!! source digest: sha256:09e047d0eeef9a273df6650d31d5c097b567a7f6b2f0c1729b5be8263cdc72d0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion account_statement_import_online_gocardless/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Online Bank Statements: GoCardless",
"version": "16.0.1.2.4",
"version": "16.0.1.2.6",
"category": "Account",
"website": "https://github.com/OCA/bank-statement-import",
"author": "ForgeFlow, Tecnativa, Odoo Community Association (OCA)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,7 @@ def _gocardless_obtain_statement_data(self, date_since, date_until):
"date": current_date,
"ref": partner_name or "/",
"payment_ref": payment_ref,
"unique_import_id": (
tr.get("entryReference")
or tr.get("transactionId")
or tr.get("internalTransactionId")
),
"unique_import_id": self._gocardless_get_unique_import_id(tr),
"amount": amount_currency,
"account_number": account_number,
"partner_name": partner_name,
Expand All @@ -381,6 +377,13 @@ def _gocardless_obtain_statement_data(self, date_since, date_until):
)
return res, {}

def _gocardless_get_unique_import_id(self, tr):
return (
tr.get("entryReference")
or tr.get("transactionId")
or tr.get("internalTransactionId")
)

def _gocardless_get_note(self, tr):
"""Override to get different notes."""
note_elements = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Online Bank Statements: GoCardless</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:86c3a6944d510b258d44f2a74e4e9e433cb0e4f9745ca156414b7a5c0d83efb1
!! source digest: sha256:09e047d0eeef9a273df6650d31d5c097b567a7f6b2f0c1729b5be8263cdc72d0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/bank-statement-import/tree/16.0/account_statement_import_online_gocardless"><img alt="OCA/bank-statement-import" src="https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_online_gocardless"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/bank-statement-import&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module provides online bank statements from GoCardless Bank Account Data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,28 @@
from dateutil.relativedelta import relativedelta

from odoo import fields
from odoo.tests import common
from odoo.tests import common, tagged

_module_ns = "odoo.addons.account_statement_import_online_gocardless"
_provider_class = (
_module_ns + ".models.online_bank_statement_provider.OnlineBankStatementProvider"
)


@tagged("post_install", "-at_install")
class TestAccountBankAccountStatementImportOnlineGocardless(common.TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
if not cls.env.company.chart_template_id:
# Load a CoA if there's none in current company
coa = cls.env.ref("l10n_generic_coa.configurable_chart_template", False)
if not coa:
# Load the first available CoA
coa = cls.env["account.chart.template"].search(
[("visible", "=", True)], limit=1
)
coa.try_loading(company=cls.env.company, install_demo=False)
cls.now = fields.Datetime.now()
cls.currency_eur = cls.env.ref("base.EUR")
cls.currency_eur.write({"active": True})
Expand Down

0 comments on commit 94b237b

Please sign in to comment.