odoo-addon-account-statement-import-sheet-file 16.0.1.2.0.2__py3-none-any.whl → 16.0.1.2.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of odoo-addon-account-statement-import-sheet-file might be problematic. Click here for more details.
- odoo/addons/account_statement_import_sheet_file/README.rst +1 -1
- odoo/addons/account_statement_import_sheet_file/__manifest__.py +1 -1
- odoo/addons/account_statement_import_sheet_file/models/account_statement_import_sheet_parser.py +17 -29
- odoo/addons/account_statement_import_sheet_file/static/description/index.html +1 -1
- odoo/addons/account_statement_import_sheet_file/tests/test_account_statement_import_sheet_file.py +34 -24
- odoo/addons/account_statement_import_sheet_file/views/account_statement_import_sheet_mapping.xml +1 -0
- {odoo_addon_account_statement_import_sheet_file-16.0.1.2.0.2.dist-info → odoo_addon_account_statement_import_sheet_file-16.0.1.2.2.dist-info}/METADATA +2 -2
- {odoo_addon_account_statement_import_sheet_file-16.0.1.2.0.2.dist-info → odoo_addon_account_statement_import_sheet_file-16.0.1.2.2.dist-info}/RECORD +10 -10
- {odoo_addon_account_statement_import_sheet_file-16.0.1.2.0.2.dist-info → odoo_addon_account_statement_import_sheet_file-16.0.1.2.2.dist-info}/WHEEL +0 -0
- {odoo_addon_account_statement_import_sheet_file-16.0.1.2.0.2.dist-info → odoo_addon_account_statement_import_sheet_file-16.0.1.2.2.dist-info}/top_level.txt +0 -0
|
@@ -7,7 +7,7 @@ Bank Statement TXT/CSV/XLSX Import
|
|
|
7
7
|
!! This file is generated by oca-gen-addon-readme !!
|
|
8
8
|
!! changes will be overwritten. !!
|
|
9
9
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
10
|
-
!! source digest: sha256:
|
|
10
|
+
!! source digest: sha256:0f0aed661702d10a70818bb7e032653813de99c96c429c20b39f661e15b5ae8f
|
|
11
11
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
12
|
|
|
13
13
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
{
|
|
6
6
|
"name": "Bank Statement TXT/CSV/XLSX Import",
|
|
7
7
|
"summary": "Import TXT/CSV or XLSX files as Bank Statements in Odoo",
|
|
8
|
-
"version": "16.0.1.2.
|
|
8
|
+
"version": "16.0.1.2.2",
|
|
9
9
|
"category": "Accounting",
|
|
10
10
|
"website": "https://github.com/OCA/bank-statement-import",
|
|
11
11
|
"author": "ForgeFlow, CorporateHub, Odoo Community Association (OCA)",
|
odoo/addons/account_statement_import_sheet_file/models/account_statement_import_sheet_parser.py
CHANGED
|
@@ -39,22 +39,22 @@ class AccountStatementImportSheetParser(models.TransientModel):
|
|
|
39
39
|
_description = "Bank Statement Import Sheet Parser"
|
|
40
40
|
|
|
41
41
|
@api.model
|
|
42
|
-
def parse_header(self,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
def parse_header(self, csv_or_xlsx, mapping):
|
|
43
|
+
if mapping.no_header:
|
|
44
|
+
return []
|
|
45
|
+
header_line = mapping.header_lines_skip_count
|
|
46
|
+
# prevent negative indexes
|
|
47
|
+
if header_line > 0:
|
|
48
|
+
header_line -= 1
|
|
49
|
+
if isinstance(csv_or_xlsx, tuple):
|
|
50
|
+
header = [
|
|
51
|
+
str(value).strip() for value in csv_or_xlsx[1].row_values(header_line)
|
|
52
|
+
]
|
|
53
|
+
else:
|
|
54
|
+
[next(csv_or_xlsx) for _i in range(header_line)]
|
|
55
|
+
header = [value.strip() for value in next(csv_or_xlsx)]
|
|
56
|
+
if mapping.offset_column:
|
|
57
|
+
header = header[mapping.offset_column :]
|
|
58
58
|
return header
|
|
59
59
|
|
|
60
60
|
@api.model
|
|
@@ -177,19 +177,7 @@ class AccountStatementImportSheetParser(models.TransientModel):
|
|
|
177
177
|
) from None
|
|
178
178
|
decoded_file = data_file.decode(detected_encoding)
|
|
179
179
|
csv_or_xlsx = reader(StringIO(decoded_file), **csv_options)
|
|
180
|
-
header =
|
|
181
|
-
if not mapping.no_header:
|
|
182
|
-
header_line = mapping.header_lines_skip_count - 1
|
|
183
|
-
if isinstance(csv_or_xlsx, tuple):
|
|
184
|
-
header = [
|
|
185
|
-
str(value).strip()
|
|
186
|
-
for value in csv_or_xlsx[1].row_values(header_line)
|
|
187
|
-
]
|
|
188
|
-
else:
|
|
189
|
-
[next(csv_or_xlsx) for _i in range(header_line)]
|
|
190
|
-
header = [value.strip() for value in next(csv_or_xlsx)]
|
|
191
|
-
if mapping.offset_column:
|
|
192
|
-
header = header[mapping.offset_column :]
|
|
180
|
+
header = self.parse_header(csv_or_xlsx, mapping)
|
|
193
181
|
|
|
194
182
|
# NOTE no seria necesario debit_column y credit_column ya que tenemos los
|
|
195
183
|
# respectivos campos related
|
|
@@ -367,7 +367,7 @@ ul.auto-toc {
|
|
|
367
367
|
!! This file is generated by oca-gen-addon-readme !!
|
|
368
368
|
!! changes will be overwritten. !!
|
|
369
369
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
370
|
-
!! source digest: sha256:
|
|
370
|
+
!! source digest: sha256:0f0aed661702d10a70818bb7e032653813de99c96c429c20b39f661e15b5ae8f
|
|
371
371
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
372
372
|
<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&target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
|
373
373
|
<p>This module allows you to import any TXT/CSV or XLSX file in Odoo as bank
|
odoo/addons/account_statement_import_sheet_file/tests/test_account_statement_import_sheet_file.py
CHANGED
|
@@ -9,50 +9,60 @@ from unittest.mock import Mock
|
|
|
9
9
|
|
|
10
10
|
from odoo import fields
|
|
11
11
|
from odoo.exceptions import UserError
|
|
12
|
-
from odoo.tests import common
|
|
12
|
+
from odoo.tests import common, tagged
|
|
13
13
|
from odoo.tools import float_round
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
@tagged("post_install", "-at_install")
|
|
16
17
|
class TestAccountStatementImportSheetFile(common.TransactionCase):
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
@classmethod
|
|
19
|
+
def setUpClass(cls):
|
|
20
|
+
super().setUpClass()
|
|
21
|
+
if not cls.env.company.chart_template_id:
|
|
22
|
+
# Load a CoA if there's none in current company
|
|
23
|
+
coa = cls.env.ref("l10n_generic_coa.configurable_chart_template", False)
|
|
24
|
+
if not coa:
|
|
25
|
+
# Load the first available CoA
|
|
26
|
+
coa = cls.env["account.chart.template"].search(
|
|
27
|
+
[("visible", "=", True)], limit=1
|
|
28
|
+
)
|
|
29
|
+
coa.try_loading(company=cls.env.company, install_demo=False)
|
|
30
|
+
cls.now = fields.Datetime.now()
|
|
31
|
+
cls.currency_eur = cls.env.ref("base.EUR")
|
|
32
|
+
cls.currency_usd = cls.env.ref("base.USD")
|
|
33
|
+
cls.currency_usd.active = True
|
|
24
34
|
# Make sure the currency of the company is USD, as this not always happens
|
|
25
35
|
# To be removed in V17: https://github.com/odoo/odoo/pull/107113
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
cls.company = cls.env.company
|
|
37
|
+
cls.env.cr.execute(
|
|
28
38
|
"UPDATE res_company SET currency_id = %s WHERE id = %s",
|
|
29
|
-
(
|
|
39
|
+
(cls.env.ref("base.USD").id, cls.company.id),
|
|
30
40
|
)
|
|
31
41
|
# Activate EUR for unit test, by default is not active
|
|
32
|
-
|
|
33
|
-
|
|
42
|
+
cls.currency_eur.active = True
|
|
43
|
+
cls.sample_statement_map = cls.env.ref(
|
|
34
44
|
"account_statement_import_sheet_file.sample_statement_map"
|
|
35
45
|
)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
cls.AccountJournal = cls.env["account.journal"]
|
|
47
|
+
cls.AccountBankStatement = cls.env["account.bank.statement"]
|
|
48
|
+
cls.AccountStatementImport = cls.env["account.statement.import"]
|
|
49
|
+
cls.AccountStatementImportSheetMapping = cls.env[
|
|
40
50
|
"account.statement.import.sheet.mapping"
|
|
41
51
|
]
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
cls.AccountStatementImportWizard = cls.env["account.statement.import"]
|
|
53
|
+
cls.suspense_account = cls.env["account.account"].create(
|
|
44
54
|
{
|
|
45
55
|
"code": "987654",
|
|
46
56
|
"name": "Suspense Account",
|
|
47
57
|
"account_type": "asset_current",
|
|
48
58
|
}
|
|
49
59
|
)
|
|
50
|
-
|
|
60
|
+
cls.parser = cls.env["account.statement.import.sheet.parser"]
|
|
51
61
|
# Mock the mapping object to return predefined separators
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
cls.mock_mapping_comma_dot = Mock()
|
|
63
|
+
cls.mock_mapping_comma_dot._get_float_separators.return_value = (",", ".")
|
|
64
|
+
cls.mock_mapping_dot_comma = Mock()
|
|
65
|
+
cls.mock_mapping_dot_comma._get_float_separators.return_value = (".", ",")
|
|
56
66
|
|
|
57
67
|
def _data_file(self, filename, encoding=None):
|
|
58
68
|
mode = "rt" if encoding else "rb"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: odoo-addon-account_statement_import_sheet_file
|
|
3
|
-
Version: 16.0.1.2.
|
|
3
|
+
Version: 16.0.1.2.2
|
|
4
4
|
Summary: Import TXT/CSV or XLSX files as Bank Statements in Odoo
|
|
5
5
|
Home-page: https://github.com/OCA/bank-statement-import
|
|
6
6
|
Author: ForgeFlow, CorporateHub, Odoo Community Association (OCA)
|
|
@@ -25,7 +25,7 @@ Bank Statement TXT/CSV/XLSX Import
|
|
|
25
25
|
!! This file is generated by oca-gen-addon-readme !!
|
|
26
26
|
!! changes will be overwritten. !!
|
|
27
27
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
28
|
-
!! source digest: sha256:
|
|
28
|
+
!! source digest: sha256:0f0aed661702d10a70818bb7e032653813de99c96c429c20b39f661e15b5ae8f
|
|
29
29
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
30
30
|
|
|
31
31
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
odoo/addons/account_statement_import_sheet_file/README.rst,sha256=
|
|
1
|
+
odoo/addons/account_statement_import_sheet_file/README.rst,sha256=MTAd0og-vugX-VhZ4zZ4amy3Frylq-HslP2Zl5OyoF8,4552
|
|
2
2
|
odoo/addons/account_statement_import_sheet_file/__init__.py,sha256=X9EJGOE2GtZbS0G82PtSXmWSZ_R8jEM0rlJTDliQjp4,21
|
|
3
|
-
odoo/addons/account_statement_import_sheet_file/__manifest__.py,sha256=
|
|
3
|
+
odoo/addons/account_statement_import_sheet_file/__manifest__.py,sha256=2ktcrLCHYh2UeQE8RabHXs7cotjYTn-HClitDDAEor8,934
|
|
4
4
|
odoo/addons/account_statement_import_sheet_file/data/map_data.xml,sha256=nz_4CchVMF9pb_SI4I6UZAt2IBPxWapX37lU6J6sTJ0,1225
|
|
5
5
|
odoo/addons/account_statement_import_sheet_file/i18n/account_statement_import_sheet_file.pot,sha256=DgDFbQyuR1YqR01mma0SDXDHR3HhzW4TLC3iP6EG6lY,27561
|
|
6
6
|
odoo/addons/account_statement_import_sheet_file/i18n/es.po,sha256=cc49_7j2MxAIgWW9qLkbSID5miCKh45jDqI2o3hRwbU,33023
|
|
@@ -15,7 +15,7 @@ odoo/addons/account_statement_import_sheet_file/models/__init__.py,sha256=RsEvd8
|
|
|
15
15
|
odoo/addons/account_statement_import_sheet_file/models/account_journal.py,sha256=F4_deAvNErZ6o1gkw9uhDrEnHyWXUKNvk09mzCVzTIw,562
|
|
16
16
|
odoo/addons/account_statement_import_sheet_file/models/account_statement_import.py,sha256=KWDYgO9-C1ZAF7JO9Qlq2ghROcJIwKhGp1CueTnA368,1932
|
|
17
17
|
odoo/addons/account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py,sha256=5TY9PwEDJhBCKDDpNR0NQI33vIs4W16ZIkPnhcDDj-Q,9281
|
|
18
|
-
odoo/addons/account_statement_import_sheet_file/models/account_statement_import_sheet_parser.py,sha256=
|
|
18
|
+
odoo/addons/account_statement_import_sheet_file/models/account_statement_import_sheet_parser.py,sha256=6tB-dXSuCkkcMmmaSpgVIJoqtB5fhoghhRnHIZKNQa8,16925
|
|
19
19
|
odoo/addons/account_statement_import_sheet_file/readme/CONFIGURE.rst,sha256=imX9sFGbzYnr4I07MZvHBZyyhBm8pLZ6AmpKNVY6zR4,213
|
|
20
20
|
odoo/addons/account_statement_import_sheet_file/readme/CONTRIBUTORS.rst,sha256=p_306T6JGwwGRrmm49r5iD5qWDZbKMdwoE6S04PdN-c,520
|
|
21
21
|
odoo/addons/account_statement_import_sheet_file/readme/DESCRIPTION.rst,sha256=lHrjCbQdpNU9QhA9vwxyRgJWJHk87YujRn6P8L2Ha3A,86
|
|
@@ -23,9 +23,9 @@ odoo/addons/account_statement_import_sheet_file/readme/HISTORY.rst,sha256=XHPod2
|
|
|
23
23
|
odoo/addons/account_statement_import_sheet_file/readme/USAGE.rst,sha256=5wVe6CMUaGqAsE-yxAuc03YSxIFnRQ9mHeFkw-UBI68,184
|
|
24
24
|
odoo/addons/account_statement_import_sheet_file/security/ir.model.access.csv,sha256=ofB5jVirJJ3FQ-uWfKFD-DIg8Lh9bYLaUDQWnb9MkgM,685
|
|
25
25
|
odoo/addons/account_statement_import_sheet_file/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
|
|
26
|
-
odoo/addons/account_statement_import_sheet_file/static/description/index.html,sha256=
|
|
26
|
+
odoo/addons/account_statement_import_sheet_file/static/description/index.html,sha256=2mrQJFu7k2MSdauFI8ogeobGBgZjlSsDiWPRUGthjGc,15515
|
|
27
27
|
odoo/addons/account_statement_import_sheet_file/tests/__init__.py,sha256=f7vTpmONnfbbcMp5wZ1p7muSkyLC2vcDONaw2VGyiBw,121
|
|
28
|
-
odoo/addons/account_statement_import_sheet_file/tests/test_account_statement_import_sheet_file.py,sha256=
|
|
28
|
+
odoo/addons/account_statement_import_sheet_file/tests/test_account_statement_import_sheet_file.py,sha256=6qjCKw87LzR6588b98UiaA-IYtJyxrtCBn1I2tgnTNw,31835
|
|
29
29
|
odoo/addons/account_statement_import_sheet_file/tests/fixtures/balance.csv,sha256=-7VrGM_IbKhOJzbX-bUMIsnd99uDIBkalTytlj2jVtk,209
|
|
30
30
|
odoo/addons/account_statement_import_sheet_file/tests/fixtures/debit_credit.csv,sha256=AaVQ9G5gqsLhxtAsYXCmFCTxpBPonKA1uxy7ue5gYYE,223
|
|
31
31
|
odoo/addons/account_statement_import_sheet_file/tests/fixtures/debit_credit_amount.csv,sha256=y-VoBcF_7WaUZhnmOqSuCv7ElCKSHRbsqKWpCH49Ams,369
|
|
@@ -45,8 +45,8 @@ odoo/addons/account_statement_import_sheet_file/tests/fixtures/sample_statement_
|
|
|
45
45
|
odoo/addons/account_statement_import_sheet_file/tests/fixtures/sample_statement_offsets.xlsx,sha256=zfuCnPrKeXQmZ3VV3FgdMY59ZDt7WOQx5PYNchNbUp0,5993
|
|
46
46
|
odoo/addons/account_statement_import_sheet_file/views/account_journal_views.xml,sha256=iROLliBEfXvtXNsyHg5Ycvx9Rw9uuNWaXxdJsk8V1V4,670
|
|
47
47
|
odoo/addons/account_statement_import_sheet_file/views/account_statement_import.xml,sha256=KhgiMxHjI5tq1RlkmDYOhejqrxN4mXLc5nT9EM9gQ5s,842
|
|
48
|
-
odoo/addons/account_statement_import_sheet_file/views/account_statement_import_sheet_mapping.xml,sha256=
|
|
49
|
-
odoo_addon_account_statement_import_sheet_file-16.0.1.2.
|
|
50
|
-
odoo_addon_account_statement_import_sheet_file-16.0.1.2.
|
|
51
|
-
odoo_addon_account_statement_import_sheet_file-16.0.1.2.
|
|
52
|
-
odoo_addon_account_statement_import_sheet_file-16.0.1.2.
|
|
48
|
+
odoo/addons/account_statement_import_sheet_file/views/account_statement_import_sheet_mapping.xml,sha256=R2mvNEQsevy9VWbtV75Jf2EwYxPsoyVaUUSr-BHJHNw,7306
|
|
49
|
+
odoo_addon_account_statement_import_sheet_file-16.0.1.2.2.dist-info/METADATA,sha256=ZfiI78gC_W6bZIaHi2tLNVll2pLsYbp1ygIFTTdQlHU,5256
|
|
50
|
+
odoo_addon_account_statement_import_sheet_file-16.0.1.2.2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
51
|
+
odoo_addon_account_statement_import_sheet_file-16.0.1.2.2.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
|
|
52
|
+
odoo_addon_account_statement_import_sheet_file-16.0.1.2.2.dist-info/RECORD,,
|
|
File without changes
|