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

Syncing from upstream OCA/bank-statement-import (16.0) #611

Merged
merged 3 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ addon | version | maintainers | summary
[account_statement_import_online_ponto](account_statement_import_online_ponto/) | 16.0.1.1.1 | | Online Bank Statements: MyPonto.com
[account_statement_import_online_qonto](account_statement_import_online_qonto/) | 16.0.1.0.1 | | Online Bank Statements: Qonto
[account_statement_import_qif](account_statement_import_qif/) | 16.0.1.0.0 | | Import QIF Bank Statements
[account_statement_import_sheet_file](account_statement_import_sheet_file/) | 16.0.1.2.1 | [![alexey-pelykh](https://github.com/alexey-pelykh.png?size=30px)](https://github.com/alexey-pelykh) | Import TXT/CSV or XLSX files as Bank Statements in Odoo
[account_statement_import_sheet_file](account_statement_import_sheet_file/) | 16.0.1.2.2 | [![alexey-pelykh](https://github.com/alexey-pelykh.png?size=30px)](https://github.com/alexey-pelykh) | Import TXT/CSV or XLSX files as Bank Statements in Odoo

[//]: # (end addons)

Expand Down
2 changes: 1 addition & 1 deletion account_statement_import_sheet_file/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Bank Statement TXT/CSV/XLSX Import
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:aecd5a898a45f817bf55c788227ec5c5ef53661ae47b83630a5ebcb97d5dc663
!! source digest: sha256:0f0aed661702d10a70818bb7e032653813de99c96c429c20b39f661e15b5ae8f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion account_statement_import_sheet_file/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Bank Statement TXT/CSV/XLSX Import",
"summary": "Import TXT/CSV or XLSX files as Bank Statements in Odoo",
"version": "16.0.1.2.1",
"version": "16.0.1.2.2",
"category": "Accounting",
"website": "https://github.com/OCA/bank-statement-import",
"author": "ForgeFlow, CorporateHub, Odoo Community Association (OCA)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Bank Statement TXT/CSV/XLSX Import</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:aecd5a898a45f817bf55c788227ec5c5ef53661ae47b83630a5ebcb97d5dc663
!! source digest: sha256:0f0aed661702d10a70818bb7e032653813de99c96c429c20b39f661e15b5ae8f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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_sheet_file"><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_sheet_file"><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 allows you to import any TXT/CSV or XLSX file in Odoo as bank
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,50 +9,60 @@

from odoo import fields
from odoo.exceptions import UserError
from odoo.tests import common
from odoo.tests import common, tagged
from odoo.tools import float_round


@tagged("post_install", "-at_install")
class TestAccountStatementImportSheetFile(common.TransactionCase):
def setUp(self):
super().setUp()

self.now = fields.Datetime.now()
self.currency_eur = self.env.ref("base.EUR")
self.currency_usd = self.env.ref("base.USD")
self.currency_usd.active = True
@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_usd = cls.env.ref("base.USD")
cls.currency_usd.active = True
# Make sure the currency of the company is USD, as this not always happens
# To be removed in V17: https://github.com/odoo/odoo/pull/107113
self.company = self.env.company
self.env.cr.execute(
cls.company = cls.env.company
cls.env.cr.execute(
"UPDATE res_company SET currency_id = %s WHERE id = %s",
(self.env.ref("base.USD").id, self.company.id),
(cls.env.ref("base.USD").id, cls.company.id),
)
# Activate EUR for unit test, by default is not active
self.currency_eur.active = True
self.sample_statement_map = self.env.ref(
cls.currency_eur.active = True
cls.sample_statement_map = cls.env.ref(
"account_statement_import_sheet_file.sample_statement_map"
)
self.AccountJournal = self.env["account.journal"]
self.AccountBankStatement = self.env["account.bank.statement"]
self.AccountStatementImport = self.env["account.statement.import"]
self.AccountStatementImportSheetMapping = self.env[
cls.AccountJournal = cls.env["account.journal"]
cls.AccountBankStatement = cls.env["account.bank.statement"]
cls.AccountStatementImport = cls.env["account.statement.import"]
cls.AccountStatementImportSheetMapping = cls.env[
"account.statement.import.sheet.mapping"
]
self.AccountStatementImportWizard = self.env["account.statement.import"]
self.suspense_account = self.env["account.account"].create(
cls.AccountStatementImportWizard = cls.env["account.statement.import"]
cls.suspense_account = cls.env["account.account"].create(
{
"code": "987654",
"name": "Suspense Account",
"account_type": "asset_current",
}
)
self.parser = self.env["account.statement.import.sheet.parser"]
cls.parser = cls.env["account.statement.import.sheet.parser"]
# Mock the mapping object to return predefined separators
self.mock_mapping_comma_dot = Mock()
self.mock_mapping_comma_dot._get_float_separators.return_value = (",", ".")
self.mock_mapping_dot_comma = Mock()
self.mock_mapping_dot_comma._get_float_separators.return_value = (".", ",")
cls.mock_mapping_comma_dot = Mock()
cls.mock_mapping_comma_dot._get_float_separators.return_value = (",", ".")
cls.mock_mapping_dot_comma = Mock()
cls.mock_mapping_dot_comma._get_float_separators.return_value = (".", ",")

def _data_file(self, filename, encoding=None):
mode = "rt" if encoding else "rb"
Expand Down
Loading