odoo-addon-account-statement-import-sheet-file 16.0.1.1.1.3__py3-none-any.whl → 17.0.1.0.0.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.

Files changed (31) hide show
  1. odoo/addons/account_statement_import_sheet_file/README.rst +35 -32
  2. odoo/addons/account_statement_import_sheet_file/__manifest__.py +1 -1
  3. odoo/addons/account_statement_import_sheet_file/i18n/account_statement_import_sheet_file.pot +1 -7
  4. odoo/addons/account_statement_import_sheet_file/i18n/es.po +3 -19
  5. odoo/addons/account_statement_import_sheet_file/i18n/es_AR.po +11 -42
  6. odoo/addons/account_statement_import_sheet_file/i18n/it.po +3 -3
  7. odoo/addons/account_statement_import_sheet_file/i18n/nl.po +5 -36
  8. odoo/addons/account_statement_import_sheet_file/i18n/pt.po +5 -36
  9. odoo/addons/account_statement_import_sheet_file/i18n/zh_CN.po +6 -36
  10. odoo/addons/account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py +5 -3
  11. odoo/addons/account_statement_import_sheet_file/models/account_statement_import_sheet_parser.py +45 -16
  12. odoo/addons/account_statement_import_sheet_file/readme/CONFIGURE.md +6 -0
  13. odoo/addons/account_statement_import_sheet_file/readme/CONTRIBUTORS.md +12 -0
  14. odoo/addons/account_statement_import_sheet_file/readme/{DESCRIPTION.rst → DESCRIPTION.md} +2 -2
  15. odoo/addons/account_statement_import_sheet_file/readme/HISTORY.md +7 -0
  16. odoo/addons/account_statement_import_sheet_file/readme/USAGE.md +5 -0
  17. odoo/addons/account_statement_import_sheet_file/static/description/index.html +12 -9
  18. odoo/addons/account_statement_import_sheet_file/tests/fixtures/sample_statement_en_empty_values.xlsx +0 -0
  19. odoo/addons/account_statement_import_sheet_file/tests/test_account_statement_import_sheet_file.py +140 -0
  20. odoo/addons/account_statement_import_sheet_file/views/account_journal_views.xml +1 -4
  21. odoo/addons/account_statement_import_sheet_file/views/account_statement_import_sheet_mapping.xml +12 -28
  22. {odoo_addon_account_statement_import_sheet_file-16.0.1.1.1.3.dist-info → odoo_addon_account_statement_import_sheet_file-17.0.1.0.0.2.dist-info}/METADATA +44 -44
  23. {odoo_addon_account_statement_import_sheet_file-16.0.1.1.1.3.dist-info → odoo_addon_account_statement_import_sheet_file-17.0.1.0.0.2.dist-info}/RECORD +25 -25
  24. {odoo_addon_account_statement_import_sheet_file-16.0.1.1.1.3.dist-info → odoo_addon_account_statement_import_sheet_file-17.0.1.0.0.2.dist-info}/WHEEL +1 -1
  25. odoo_addon_account_statement_import_sheet_file-17.0.1.0.0.2.dist-info/top_level.txt +1 -0
  26. odoo/addons/account_statement_import_sheet_file/migrations/16.0.1.0.0/pre-migration.py +0 -45
  27. odoo/addons/account_statement_import_sheet_file/readme/CONFIGURE.rst +0 -4
  28. odoo/addons/account_statement_import_sheet_file/readme/CONTRIBUTORS.rst +0 -17
  29. odoo/addons/account_statement_import_sheet_file/readme/HISTORY.rst +0 -7
  30. odoo/addons/account_statement_import_sheet_file/readme/USAGE.rst +0 -4
  31. odoo_addon_account_statement_import_sheet_file-16.0.1.1.1.3.dist-info/top_level.txt +0 -1
@@ -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:622f4de81eaea0676a7c563933b1d1a0d0eae98e7e22d882526af7b611ba3d50
10
+ !! source digest: sha256:90ec58274c675f5d4eb830271ef275cb5cd09e5c62babf88fd1ee82e5f228368
11
11
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
12
 
13
13
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -17,19 +17,19 @@ Bank Statement TXT/CSV/XLSX Import
17
17
  :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18
18
  :alt: License: AGPL-3
19
19
  .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github
20
- :target: https://github.com/OCA/bank-statement-import/tree/16.0/account_statement_import_sheet_file
20
+ :target: https://github.com/OCA/bank-statement-import/tree/17.0/account_statement_import_sheet_file
21
21
  :alt: OCA/bank-statement-import
22
22
  .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23
- :target: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_sheet_file
23
+ :target: https://translation.odoo-community.org/projects/bank-statement-import-17-0/bank-statement-import-17-0-account_statement_import_sheet_file
24
24
  :alt: Translate me on Weblate
25
25
  .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26
- :target: https://runboat.odoo-community.org/builds?repo=OCA/bank-statement-import&target_branch=16.0
26
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/bank-statement-import&target_branch=17.0
27
27
  :alt: Try me on Runboat
28
28
 
29
29
  |badge1| |badge2| |badge3| |badge4| |badge5|
30
30
 
31
- This module allows you to import any TXT/CSV or XLSX file in Odoo as bank
32
- statements.
31
+ This module allows you to import any TXT/CSV or XLSX file in Odoo as
32
+ bank statements.
33
33
 
34
34
  **Table of contents**
35
35
 
@@ -41,27 +41,30 @@ Configuration
41
41
 
42
42
  To create TXT/CSV/XLSX statement sheet columns mapping:
43
43
 
44
- #. Open *Invoicing > Configuration > Accounting > Statement Sheet Mappings*
45
- #. Create mapping(s) according to your online banking software statement format
44
+ 1. Open *Invoicing > Configuration > Accounting > Statement Sheet
45
+ Mappings*
46
+ 2. Create mapping(s) according to your online banking software statement
47
+ format
46
48
 
47
49
  Usage
48
50
  =====
49
51
 
50
52
  To use this module, you need to:
51
53
 
52
- #. Get statement in TXT/CSV or XLSX from your online banking software
53
- #. Go to Odoo and and import the statement file, selecting corresponding format
54
+ 1. Get statement in TXT/CSV or XLSX from your online banking software
55
+ 2. Go to Odoo and and import the statement file, selecting corresponding
56
+ format
54
57
 
55
58
  Changelog
56
59
  =========
57
60
 
58
61
  12.0.2.0.0
59
- ~~~~~~~~~~
62
+ ----------
60
63
 
61
- * [BREAKING] New mapping, please review mappings after upgrade.
62
- * [BREAKING] Different bank accounts have to be used per each currency.
63
- * [ADD] Support for both Statement and Activity reports.
64
- * [ADD] Separate fee and currency exchange parsing.
64
+ - [BREAKING] New mapping, please review mappings after upgrade.
65
+ - [BREAKING] Different bank accounts have to be used per each currency.
66
+ - [ADD] Support for both Statement and Activity reports.
67
+ - [ADD] Separate fee and currency exchange parsing.
65
68
 
66
69
  Bug Tracker
67
70
  ===========
@@ -69,7 +72,7 @@ Bug Tracker
69
72
  Bugs are tracked on `GitHub Issues <https://github.com/OCA/bank-statement-import/issues>`_.
70
73
  In case of trouble, please check there if your issue has already been reported.
71
74
  If you spotted it first, help us to smash it by providing a detailed and welcomed
72
- `feedback <https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_statement_import_sheet_file%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
75
+ `feedback <https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_statement_import_sheet_file%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
73
76
 
74
77
  Do not contact contributors directly about support or help with technical issues.
75
78
 
@@ -77,34 +80,34 @@ Credits
77
80
  =======
78
81
 
79
82
  Authors
80
- ~~~~~~~
83
+ -------
81
84
 
82
85
  * ForgeFlow
83
86
  * CorporateHub
84
87
 
85
88
  Contributors
86
- ~~~~~~~~~~~~
89
+ ------------
87
90
 
88
- * Alexis de Lattre <alexis.delattre@akretion.com>
89
- * Sebastien BEAU <sebastien.beau@akretion.com>
90
- * Katherine Zaoral
91
- * Tecnativa (https://www.tecnativa.com)
91
+ - Alexis de Lattre <alexis.delattre@akretion.com>
92
+ - Sebastien BEAU <sebastien.beau@akretion.com>
93
+ - Katherine Zaoral
94
+ - Tecnativa (https://www.tecnativa.com)
92
95
 
93
- * Vicent Cubells
94
- * Victor M.M. Torres
95
- * Víctor Martínez
96
+ - Vicent Cubells
97
+ - Victor M.M. Torres
98
+ - Víctor Martínez
96
99
 
97
- * ForgeFlow (https://www.forgeflow.com)
100
+ - ForgeFlow (https://www.forgeflow.com)
98
101
 
99
- * Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
100
- * Miquel Raïch Regué <miquel.raich@forgeflow.com>
102
+ - Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
103
+ - Miquel Raïch Regué <miquel.raich@forgeflow.com>
101
104
 
102
- * `CorporateHub <https://corporatehub.eu/>`__
105
+ - `CorporateHub <https://corporatehub.eu/>`__
103
106
 
104
- * Alexey Pelykh <alexey.pelykh@corphub.eu>
107
+ - Alexey Pelykh <alexey.pelykh@corphub.eu>
105
108
 
106
109
  Maintainers
107
- ~~~~~~~~~~~
110
+ -----------
108
111
 
109
112
  This module is maintained by the OCA.
110
113
 
@@ -124,6 +127,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
124
127
 
125
128
  |maintainer-alexey-pelykh|
126
129
 
127
- This module is part of the `OCA/bank-statement-import <https://github.com/OCA/bank-statement-import/tree/16.0/account_statement_import_sheet_file>`_ project on GitHub.
130
+ This module is part of the `OCA/bank-statement-import <https://github.com/OCA/bank-statement-import/tree/17.0/account_statement_import_sheet_file>`_ project on GitHub.
128
131
 
129
132
  You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
@@ -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.1.1",
8
+ "version": "17.0.1.0.0",
9
9
  "category": "Accounting",
10
10
  "website": "https://github.com/OCA/bank-statement-import",
11
11
  "author": "ForgeFlow, CorporateHub, Odoo Community Association (OCA)",
@@ -4,7 +4,7 @@
4
4
  #
5
5
  msgid ""
6
6
  msgstr ""
7
- "Project-Id-Version: Odoo Server 16.0\n"
7
+ "Project-Id-Version: Odoo Server 17.0\n"
8
8
  "Report-Msgid-Bugs-To: \n"
9
9
  "Last-Translator: \n"
10
10
  "Language-Team: \n"
@@ -290,12 +290,6 @@ msgstr ""
290
290
  msgid "Journal"
291
291
  msgstr ""
292
292
 
293
- #. module: account_statement_import_sheet_file
294
- #: model:ir.model.fields,field_description:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping____last_update
295
- #: model:ir.model.fields,field_description:account_statement_import_sheet_file.field_account_statement_import_sheet_parser____last_update
296
- msgid "Last Modified on"
297
- msgstr ""
298
-
299
293
  #. module: account_statement_import_sheet_file
300
294
  #: model:ir.model.fields,field_description:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__write_uid
301
295
  #: model:ir.model.fields,field_description:account_statement_import_sheet_file.field_account_statement_import_sheet_parser__write_uid
@@ -415,10 +415,10 @@ msgstr "Valor simple"
415
415
  #. module: account_statement_import_sheet_file
416
416
  #: model:ir.model.fields,help:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__amount_type
417
417
  msgid ""
418
- "Simple value: use igned amount in amount column\n"
419
- "Absolute Value: use a same column for debit and credit\n"
418
+ "Simple value: use igned amount in ammount comlumn\n"
419
+ "Absolute Value: use a same comlumn for debit and credit\n"
420
420
  "(absolute value + indicate sign)\n"
421
- "Distinct Credit/debit Column: use a distinct column for debit and credit"
421
+ "Distinct Credit/debit Column: use a distinct comlumn for debit and credit"
422
422
  msgstr ""
423
423
  "Valor simple: utilizar un importe ignorado en la columna importe\n"
424
424
  "Valor absoluto: utilizar una misma columna para el debe y el haber\n"
@@ -622,19 +622,3 @@ msgstr "espacio"
622
622
  #: model:ir.model.fields.selection,name:account_statement_import_sheet_file.selection__account_statement_import_sheet_mapping__delimiter__tab
623
623
  msgid "tab"
624
624
  msgstr "tabulador"
625
-
626
- #~ msgid ""
627
- #~ "Simple value: use igned amount in ammount comlumn\n"
628
- #~ "Absolute Value: use a same comlumn for debit and credit\n"
629
- #~ "(absolute value + indicate sign)\n"
630
- #~ "Distinct Credit/debit Column: use a distinct comlumn for debit and credit"
631
- #~ msgstr ""
632
- #~ "Valor simple: utilizar un importe ignorado en la columna importe\n"
633
- #~ "Valor absoluto: utilizar una misma columna para el Debe y el Haber\n"
634
- #~ "(valor absoluto + signo indicativo)\n"
635
- #~ "Columna distinta para débito y crédito: utilice una columna distinta para "
636
- #~ "débito y crédito"
637
-
638
- #~ msgid "Use amount_column OR (amount_debit_column AND amount_credit_column)."
639
- #~ msgstr ""
640
- #~ "Usar amount_column OR (amount_debit_column AND amount_credit_column)."
@@ -240,6 +240,7 @@ msgstr "Mostrar Nombre"
240
240
  #. module: account_statement_import_sheet_file
241
241
  #: model:ir.model.fields.selection,name:account_statement_import_sheet_file.selection__account_statement_import_sheet_mapping__amount_type__distinct_credit_debit
242
242
  #, fuzzy
243
+ #| msgid "Debit/Credit column"
243
244
  msgid "Distinct Credit/debit Column"
244
245
  msgstr "Columna de Débito/Crédito"
245
246
 
@@ -305,19 +306,6 @@ msgstr ""
305
306
  "transacciones con conversión automática de moneda, columna para obtener el "
306
307
  "monto de la transacción original en la moneda de la transacción original"
307
308
 
308
- #. module: account_statement_import_sheet_file
309
- #: model:ir.model.fields,help:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__amount_inverse_sign
310
- msgid ""
311
- "In some cases such as in credit card statements the amounts are expressed in "
312
- "the inverse sign. By setting this flag during the upload the amounts will be "
313
- "inverted in sign."
314
- msgstr ""
315
-
316
- #. module: account_statement_import_sheet_file
317
- #: model:ir.model.fields,field_description:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__amount_inverse_sign
318
- msgid "Inverse sign of amount"
319
- msgstr ""
320
-
321
309
  #. module: account_statement_import_sheet_file
322
310
  #: model:ir.model.fields.selection,name:account_statement_import_sheet_file.selection__account_statement_import_sheet_mapping__file_encoding__shift_jis
323
311
  msgid "Japanese (Shift JIS)"
@@ -431,10 +419,10 @@ msgstr ""
431
419
  #. module: account_statement_import_sheet_file
432
420
  #: model:ir.model.fields,help:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__amount_type
433
421
  msgid ""
434
- "Simple value: use igned amount in amount column\n"
435
- "Absolute Value: use a same column for debit and credit\n"
422
+ "Simple value: use igned amount in ammount comlumn\n"
423
+ "Absolute Value: use a same comlumn for debit and credit\n"
436
424
  "(absolute value + indicate sign)\n"
437
- "Distinct Credit/debit Column: use a distinct column for debit and credit"
425
+ "Distinct Credit/debit Column: use a distinct comlumn for debit and credit"
438
426
  msgstr ""
439
427
 
440
428
  #. module: account_statement_import_sheet_file
@@ -517,31 +505,17 @@ msgid "Unique transaction ID column"
517
505
  msgstr "Columna de ID único de transacción"
518
506
 
519
507
  #. module: account_statement_import_sheet_file
520
- #. odoo-python
521
- #: code:addons/account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py:0
522
- #, python-format
523
- msgid "Use amount_column if you have set Amount type = 'Single value'"
524
- msgstr ""
525
-
526
- #. module: account_statement_import_sheet_file
527
- #. odoo-python
528
- #: code:addons/account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py:0
529
- #, python-format
530
- msgid ""
531
- "Use amount_debit_column and amount_credit_column if you have set Amount type "
532
- "= 'Distinct Credit/debit Column'"
533
- msgstr ""
534
-
535
- #. module: account_statement_import_sheet_file
536
- #. odoo-python
537
- #: code:addons/account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py:0
538
- #, python-format
539
- msgid "Use debit_credit_column if you have set Amount type = 'Absolute value'"
540
- msgstr ""
508
+ #: model:ir.model.constraint,message:account_statement_import_sheet_file.constraint_account_statement_import_sheet_mapping_check_amount_columns
509
+ #, fuzzy
510
+ msgid "Use amount_column OR (amount_debit_column AND amount_credit_column)."
511
+ msgstr "Usar amount_column OR (amount_debit_column AND amount_credit_column)."
541
512
 
542
513
  #. module: account_statement_import_sheet_file
543
514
  #: model:ir.model.fields,help:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__debit_credit_column
544
515
  #, fuzzy
516
+ #| msgid ""
517
+ #| "Some statement formats use absolute amount value and indicate signof the "
518
+ #| "transaction by specifying if it was a debit or a credit one"
545
519
  msgid ""
546
520
  "Used if amount type is \"Absolute value\"\n"
547
521
  "Some statement formats use absolute amount value and indicate sign\n"
@@ -629,8 +603,3 @@ msgstr "espacio"
629
603
  #: model:ir.model.fields.selection,name:account_statement_import_sheet_file.selection__account_statement_import_sheet_mapping__delimiter__tab
630
604
  msgid "tab"
631
605
  msgstr "tabulación"
632
-
633
- #, fuzzy
634
- #~ msgid "Use amount_column OR (amount_debit_column AND amount_credit_column)."
635
- #~ msgstr ""
636
- #~ "Usar amount_column OR (amount_debit_column AND amount_credit_column)."
@@ -415,10 +415,10 @@ msgstr "Valore semplice"
415
415
  #. module: account_statement_import_sheet_file
416
416
  #: model:ir.model.fields,help:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__amount_type
417
417
  msgid ""
418
- "Simple value: use igned amount in amount column\n"
419
- "Absolute Value: use a same column for debit and credit\n"
418
+ "Simple value: use igned amount in ammount comlumn\n"
419
+ "Absolute Value: use a same comlumn for debit and credit\n"
420
420
  "(absolute value + indicate sign)\n"
421
- "Distinct Credit/debit Column: use a distinct column for debit and credit"
421
+ "Distinct Credit/debit Column: use a distinct comlumn for debit and credit"
422
422
  msgstr ""
423
423
  "Valore semplice: usa il valore con segno nella colonna importo\n"
424
424
  "Valore assoluto: usa la stessa colonna per debito e credito\n"
@@ -276,19 +276,6 @@ msgid ""
276
276
  "transaction currency from"
277
277
  msgstr ""
278
278
 
279
- #. module: account_statement_import_sheet_file
280
- #: model:ir.model.fields,help:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__amount_inverse_sign
281
- msgid ""
282
- "In some cases such as in credit card statements the amounts are expressed in "
283
- "the inverse sign. By setting this flag during the upload the amounts will be "
284
- "inverted in sign."
285
- msgstr ""
286
-
287
- #. module: account_statement_import_sheet_file
288
- #: model:ir.model.fields,field_description:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__amount_inverse_sign
289
- msgid "Inverse sign of amount"
290
- msgstr ""
291
-
292
279
  #. module: account_statement_import_sheet_file
293
280
  #: model:ir.model.fields.selection,name:account_statement_import_sheet_file.selection__account_statement_import_sheet_mapping__file_encoding__shift_jis
294
281
  msgid "Japanese (Shift JIS)"
@@ -398,10 +385,10 @@ msgstr ""
398
385
  #. module: account_statement_import_sheet_file
399
386
  #: model:ir.model.fields,help:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__amount_type
400
387
  msgid ""
401
- "Simple value: use igned amount in amount column\n"
402
- "Absolute Value: use a same column for debit and credit\n"
388
+ "Simple value: use igned amount in ammount comlumn\n"
389
+ "Absolute Value: use a same comlumn for debit and credit\n"
403
390
  "(absolute value + indicate sign)\n"
404
- "Distinct Credit/debit Column: use a distinct column for debit and credit"
391
+ "Distinct Credit/debit Column: use a distinct comlumn for debit and credit"
405
392
  msgstr ""
406
393
 
407
394
  #. module: account_statement_import_sheet_file
@@ -483,26 +470,8 @@ msgid "Unique transaction ID column"
483
470
  msgstr "Unieke transactie ID kolom"
484
471
 
485
472
  #. module: account_statement_import_sheet_file
486
- #. odoo-python
487
- #: code:addons/account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py:0
488
- #, python-format
489
- msgid "Use amount_column if you have set Amount type = 'Single value'"
490
- msgstr ""
491
-
492
- #. module: account_statement_import_sheet_file
493
- #. odoo-python
494
- #: code:addons/account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py:0
495
- #, python-format
496
- msgid ""
497
- "Use amount_debit_column and amount_credit_column if you have set Amount type "
498
- "= 'Distinct Credit/debit Column'"
499
- msgstr ""
500
-
501
- #. module: account_statement_import_sheet_file
502
- #. odoo-python
503
- #: code:addons/account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py:0
504
- #, python-format
505
- msgid "Use debit_credit_column if you have set Amount type = 'Absolute value'"
473
+ #: model:ir.model.constraint,message:account_statement_import_sheet_file.constraint_account_statement_import_sheet_mapping_check_amount_columns
474
+ msgid "Use amount_column OR (amount_debit_column AND amount_credit_column)."
506
475
  msgstr ""
507
476
 
508
477
  #. module: account_statement_import_sheet_file
@@ -277,19 +277,6 @@ msgid ""
277
277
  "transaction currency from"
278
278
  msgstr ""
279
279
 
280
- #. module: account_statement_import_sheet_file
281
- #: model:ir.model.fields,help:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__amount_inverse_sign
282
- msgid ""
283
- "In some cases such as in credit card statements the amounts are expressed in "
284
- "the inverse sign. By setting this flag during the upload the amounts will be "
285
- "inverted in sign."
286
- msgstr ""
287
-
288
- #. module: account_statement_import_sheet_file
289
- #: model:ir.model.fields,field_description:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__amount_inverse_sign
290
- msgid "Inverse sign of amount"
291
- msgstr ""
292
-
293
280
  #. module: account_statement_import_sheet_file
294
281
  #: model:ir.model.fields.selection,name:account_statement_import_sheet_file.selection__account_statement_import_sheet_mapping__file_encoding__shift_jis
295
282
  msgid "Japanese (Shift JIS)"
@@ -401,10 +388,10 @@ msgstr ""
401
388
  #. module: account_statement_import_sheet_file
402
389
  #: model:ir.model.fields,help:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__amount_type
403
390
  msgid ""
404
- "Simple value: use igned amount in amount column\n"
405
- "Absolute Value: use a same column for debit and credit\n"
391
+ "Simple value: use igned amount in ammount comlumn\n"
392
+ "Absolute Value: use a same comlumn for debit and credit\n"
406
393
  "(absolute value + indicate sign)\n"
407
- "Distinct Credit/debit Column: use a distinct column for debit and credit"
394
+ "Distinct Credit/debit Column: use a distinct comlumn for debit and credit"
408
395
  msgstr ""
409
396
 
410
397
  #. module: account_statement_import_sheet_file
@@ -486,26 +473,8 @@ msgid "Unique transaction ID column"
486
473
  msgstr ""
487
474
 
488
475
  #. module: account_statement_import_sheet_file
489
- #. odoo-python
490
- #: code:addons/account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py:0
491
- #, python-format
492
- msgid "Use amount_column if you have set Amount type = 'Single value'"
493
- msgstr ""
494
-
495
- #. module: account_statement_import_sheet_file
496
- #. odoo-python
497
- #: code:addons/account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py:0
498
- #, python-format
499
- msgid ""
500
- "Use amount_debit_column and amount_credit_column if you have set Amount type "
501
- "= 'Distinct Credit/debit Column'"
502
- msgstr ""
503
-
504
- #. module: account_statement_import_sheet_file
505
- #. odoo-python
506
- #: code:addons/account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py:0
507
- #, python-format
508
- msgid "Use debit_credit_column if you have set Amount type = 'Absolute value'"
476
+ #: model:ir.model.constraint,message:account_statement_import_sheet_file.constraint_account_statement_import_sheet_mapping_check_amount_columns
477
+ msgid "Use amount_column OR (amount_debit_column AND amount_credit_column)."
509
478
  msgstr ""
510
479
 
511
480
  #. module: account_statement_import_sheet_file
@@ -220,6 +220,7 @@ msgstr "显示名称"
220
220
  #. module: account_statement_import_sheet_file
221
221
  #: model:ir.model.fields.selection,name:account_statement_import_sheet_file.selection__account_statement_import_sheet_mapping__amount_type__distinct_credit_debit
222
222
  #, fuzzy
223
+ #| msgid "Debit/Credit column"
223
224
  msgid "Distinct Credit/debit Column"
224
225
  msgstr "借贷标志列名"
225
226
 
@@ -277,19 +278,6 @@ msgid ""
277
278
  "transaction currency from"
278
279
  msgstr ""
279
280
 
280
- #. module: account_statement_import_sheet_file
281
- #: model:ir.model.fields,help:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__amount_inverse_sign
282
- msgid ""
283
- "In some cases such as in credit card statements the amounts are expressed in "
284
- "the inverse sign. By setting this flag during the upload the amounts will be "
285
- "inverted in sign."
286
- msgstr ""
287
-
288
- #. module: account_statement_import_sheet_file
289
- #: model:ir.model.fields,field_description:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__amount_inverse_sign
290
- msgid "Inverse sign of amount"
291
- msgstr ""
292
-
293
281
  #. module: account_statement_import_sheet_file
294
282
  #: model:ir.model.fields.selection,name:account_statement_import_sheet_file.selection__account_statement_import_sheet_mapping__file_encoding__shift_jis
295
283
  msgid "Japanese (Shift JIS)"
@@ -398,10 +386,10 @@ msgstr ""
398
386
  #. module: account_statement_import_sheet_file
399
387
  #: model:ir.model.fields,help:account_statement_import_sheet_file.field_account_statement_import_sheet_mapping__amount_type
400
388
  msgid ""
401
- "Simple value: use igned amount in amount column\n"
402
- "Absolute Value: use a same column for debit and credit\n"
389
+ "Simple value: use igned amount in ammount comlumn\n"
390
+ "Absolute Value: use a same comlumn for debit and credit\n"
403
391
  "(absolute value + indicate sign)\n"
404
- "Distinct Credit/debit Column: use a distinct column for debit and credit"
392
+ "Distinct Credit/debit Column: use a distinct comlumn for debit and credit"
405
393
  msgstr ""
406
394
 
407
395
  #. module: account_statement_import_sheet_file
@@ -483,26 +471,8 @@ msgid "Unique transaction ID column"
483
471
  msgstr "唯一交易ID列名"
484
472
 
485
473
  #. module: account_statement_import_sheet_file
486
- #. odoo-python
487
- #: code:addons/account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py:0
488
- #, python-format
489
- msgid "Use amount_column if you have set Amount type = 'Single value'"
490
- msgstr ""
491
-
492
- #. module: account_statement_import_sheet_file
493
- #. odoo-python
494
- #: code:addons/account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py:0
495
- #, python-format
496
- msgid ""
497
- "Use amount_debit_column and amount_credit_column if you have set Amount type "
498
- "= 'Distinct Credit/debit Column'"
499
- msgstr ""
500
-
501
- #. module: account_statement_import_sheet_file
502
- #. odoo-python
503
- #: code:addons/account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py:0
504
- #, python-format
505
- msgid "Use debit_credit_column if you have set Amount type = 'Absolute value'"
474
+ #: model:ir.model.constraint,message:account_statement_import_sheet_file.constraint_account_statement_import_sheet_mapping_check_amount_columns
475
+ msgid "Use amount_column OR (amount_debit_column AND amount_credit_column)."
506
476
  msgstr ""
507
477
 
508
478
  #. module: account_statement_import_sheet_file
@@ -63,8 +63,9 @@ class AccountStatementImportSheetMapping(models.Model):
63
63
  timestamp_format = fields.Char(required=True)
64
64
  no_header = fields.Boolean(
65
65
  string="File does not contain header line",
66
- help="When this occurs please indicate the column number in the Columns section "
67
- "instead of the column name, considering that the first column is 0",
66
+ help="When this occurs please indicate the column number in "
67
+ "the Columns section instead of the column name, considering "
68
+ "that the first column is 0",
68
69
  )
69
70
  timestamp_column = fields.Char(required=True)
70
71
  currency_column = fields.Char(
@@ -190,7 +191,8 @@ class AccountStatementImportSheetMapping(models.Model):
190
191
  elif item.amount_type == "absolute_value" and not item.debit_credit_column:
191
192
  raise ValidationError(
192
193
  _(
193
- "Use debit_credit_column if you have set Amount type = 'Absolute value'"
194
+ "Use debit_credit_column if you have set "
195
+ "Amount type = 'Absolute value'"
194
196
  )
195
197
  )
196
198
  elif item.amount_type == "distinct_credit_debit" and (
@@ -4,6 +4,8 @@
4
4
 
5
5
  import itertools
6
6
  import logging
7
+ import math
8
+ import re
7
9
  from collections.abc import Iterable
8
10
  from datetime import datetime
9
11
  from decimal import Decimal
@@ -20,7 +22,7 @@ try:
20
22
 
21
23
  import xlrd
22
24
  from xlrd.xldate import xldate_as_datetime
23
- except (ImportError, IOError) as err: # pragma: no cover
25
+ except (OSError, ImportError) as err: # pragma: no cover
24
26
  _logger.error(err)
25
27
 
26
28
  try:
@@ -83,8 +85,8 @@ class AccountStatementImportSheetParser(models.TransientModel):
83
85
  balance_end = last_line["balance"]
84
86
  data.update(
85
87
  {
86
- "balance_start": float(balance_start),
87
- "balance_end_real": float(balance_end),
88
+ "balance_start": balance_start,
89
+ "balance_end_real": balance_end,
88
90
  }
89
91
  )
90
92
  transactions = list(
@@ -254,18 +256,18 @@ class AccountStatementImportSheetParser(models.TransientModel):
254
256
  else currency_code
255
257
  )
256
258
 
257
- def _decimal(column_name):
259
+ def _decimal(column_name, values):
258
260
  if columns[column_name]:
259
261
  return self._parse_decimal(
260
262
  self._get_values_from_column(values, columns, column_name),
261
263
  mapping,
262
264
  )
263
265
 
264
- amount = _decimal("amount_column")
266
+ amount = _decimal("amount_column", values)
265
267
  if not amount:
266
- amount = abs(_decimal("amount_debit_column") or 0)
268
+ amount = abs(_decimal("amount_debit_column", values) or 0)
267
269
  if not amount:
268
- amount = -abs(_decimal("amount_credit_column") or 0)
270
+ amount = -abs(_decimal("amount_credit_column", values) or 0)
269
271
 
270
272
  balance = (
271
273
  self._get_values_from_column(values, columns, "balance_column")
@@ -324,6 +326,19 @@ class AccountStatementImportSheetParser(models.TransientModel):
324
326
  if columns["bank_account_column"]
325
327
  else None
326
328
  )
329
+
330
+ debit_column = (
331
+ self._get_values_from_column(values, columns, "amount_debit_column")
332
+ if columns["amount_debit_column"]
333
+ else None
334
+ )
335
+
336
+ credit_column = (
337
+ self._get_values_from_column(values, columns, "amount_credit_column")
338
+ if columns["amount_credit_column"]
339
+ else None
340
+ )
341
+
327
342
  if currency != currency_code:
328
343
  continue
329
344
 
@@ -336,14 +351,21 @@ class AccountStatementImportSheetParser(models.TransientModel):
336
351
  balance = None
337
352
 
338
353
  if debit_credit is not None:
339
- amount = amount.copy_abs()
354
+ amount = abs(amount)
340
355
  if debit_credit == mapping.debit_value:
341
356
  amount = -amount
342
357
 
358
+ if debit_column and credit_column:
359
+ debit_amount = self._parse_decimal(debit_column, mapping)
360
+ debit_amount = abs(debit_amount)
361
+ credit_amount = self._parse_decimal(credit_column, mapping)
362
+ credit_amount = abs(credit_amount)
363
+ amount = -(credit_amount - debit_amount)
364
+
343
365
  if original_amount:
344
- original_amount = self._parse_decimal(
345
- original_amount, mapping
346
- ).copy_sign(amount)
366
+ original_amount = math.copysign(
367
+ self._parse_decimal(original_amount, mapping), amount
368
+ )
347
369
  else:
348
370
  original_amount = 0.0
349
371
  if mapping.amount_inverse_sign:
@@ -439,7 +461,7 @@ class AccountStatementImportSheetParser(models.TransientModel):
439
461
  if transaction_id:
440
462
  note += _("Transaction ID: %s; ") % (transaction_id,)
441
463
  if note and notes:
442
- note = "{}\n{}".format(notes, note.strip())
464
+ note = f"{notes}\n{note.strip()}"
443
465
  elif note:
444
466
  note = note.strip()
445
467
  elif notes:
@@ -457,11 +479,18 @@ class AccountStatementImportSheetParser(models.TransientModel):
457
479
  @api.model
458
480
  def _parse_decimal(self, value, mapping):
459
481
  if isinstance(value, Decimal):
460
- return value
482
+ return float(value)
461
483
  elif isinstance(value, float):
462
- return Decimal(value)
463
- value = value or "0"
484
+ return value
464
485
  thousands, decimal = mapping._get_float_separators()
486
+ # Remove all characters except digits, thousands separator,
487
+ # decimal separator, and signs
488
+ value = (
489
+ re.sub(
490
+ r"[^\d\-+" + re.escape(thousands) + re.escape(decimal) + "]+", "", value
491
+ )
492
+ or "0"
493
+ )
465
494
  value = value.replace(thousands, "")
466
495
  value = value.replace(decimal, ".")
467
- return Decimal(value)
496
+ return float(value)