Skip to content

Commit

Permalink
[IMP] account_statement_import_fr_cfonb: pre-commit auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcLSubteno committed Aug 13, 2024
1 parent b93e024 commit 85dcf12
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 37 deletions.
36 changes: 23 additions & 13 deletions account_statement_import_fr_cfonb/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,30 @@ Import French CFONB Bank Statements
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--france-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-france/tree/16.0/account_statement_import_fr_cfonb
:target: https://github.com/OCA/l10n-france/tree/17.0/account_statement_import_fr_cfonb
:alt: OCA/l10n-france
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-france-16-0/l10n-france-16-0-account_statement_import_fr_cfonb
:target: https://translation.odoo-community.org/projects/l10n-france-17-0/l10n-france-17-0-account_statement_import_fr_cfonb
: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/l10n-france&target_branch=16.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-france&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows you to import the text-based French CFONB bank statements files in Odoo.
This module allows you to import the text-based French CFONB bank
statements files in Odoo.

The specifications are available on the `official CFONB website <https://www.cfonb.org>`_ under the section *Espace documentaire > Organisation des échanges > Restituation d'information*. The document is named *Relevé de compte sur support informatique* (`direct link <https://www.cfonb.org/fichiers/20130612113947_7_4_Releve_de_Compte_sur_support_informatique_2004_07.pdf>`_).
The specifications are available on the `official CFONB
website <https://www.cfonb.org>`__ under the section *Espace
documentaire > Organisation des échanges > Restituation d'information*.
The document is named *Relevé de compte sur support informatique*
(`direct
link <https://www.cfonb.org/fichiers/20130612113947_7_4_Releve_de_Compte_sur_support_informatique_2004_07.pdf>`__).

Since Odoo v14, multi-account CFONB files are supported. When you import such a file, several bank statements will be generated: one for each bank account.
Since Odoo v14, multi-account CFONB files are supported. When you import
such a file, several bank statements will be generated: one for each
bank account.

**Table of contents**

Expand All @@ -42,33 +50,35 @@ Since Odoo v14, multi-account CFONB files are supported. When you import such a
Usage
=====

In the dashboard of the *Invoicing* menu, click on the button *Import Statements* on any bank statement journal and follow the instructions of the wizard.
In the dashboard of the *Invoicing* menu, click on the button *Import
Statements* on any bank statement journal and follow the instructions of
the wizard.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-france/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/l10n-france/issues/new?body=module:%20account_statement_import_fr_cfonb%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/l10n-france/issues/new?body=module:%20account_statement_import_fr_cfonb%0Aversion:%2017.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
~~~~~~~
-------

* Akretion

Contributors
~~~~~~~~~~~~
------------

* Alexis de Lattre <[email protected]>
- Alexis de Lattre <[email protected]>

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -88,6 +98,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-alexis-via|

This module is part of the `OCA/l10n-france <https://github.com/OCA/l10n-france/tree/16.0/account_statement_import_fr_cfonb>`_ project on GitHub.
This module is part of the `OCA/l10n-france <https://github.com/OCA/l10n-france/tree/17.0/account_statement_import_fr_cfonb>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions account_statement_import_fr_cfonb/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions account_statement_import_fr_cfonb/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Alexis de Lattre \<<[email protected]>\>
1 change: 0 additions & 1 deletion account_statement_import_fr_cfonb/readme/CONTRIBUTORS.rst

This file was deleted.

12 changes: 12 additions & 0 deletions account_statement_import_fr_cfonb/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
This module allows you to import the text-based French CFONB bank
statements files in Odoo.

The specifications are available on the [official CFONB
website](https://www.cfonb.org) under the section *Espace documentaire
\> Organisation des échanges \> Restituation d'information*. The
document is named *Relevé de compte sur support informatique* ([direct
link](https://www.cfonb.org/fichiers/20130612113947_7_4_Releve_de_Compte_sur_support_informatique_2004_07.pdf)).

Since Odoo v14, multi-account CFONB files are supported. When you import
such a file, several bank statements will be generated: one for each
bank account.
5 changes: 0 additions & 5 deletions account_statement_import_fr_cfonb/readme/DESCRIPTION.rst

This file was deleted.

3 changes: 3 additions & 0 deletions account_statement_import_fr_cfonb/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
In the dashboard of the *Invoicing* menu, click on the button *Import
Statements* on any bank statement journal and follow the instructions of
the wizard.
1 change: 0 additions & 1 deletion account_statement_import_fr_cfonb/readme/USAGE.rst

This file was deleted.

35 changes: 24 additions & 11 deletions account_statement_import_fr_cfonb/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -368,10 +369,18 @@ <h1 class="title">Import French CFONB Bank Statements</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:07f7afc3f1e59e76567d05d57947ce63586cb8b61253436bd5afb0d23bd5f01a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/l10n-france/tree/16.0/account_statement_import_fr_cfonb"><img alt="OCA/l10n-france" src="https://img.shields.io/badge/github-OCA%2Fl10n--france-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-france-16-0/l10n-france-16-0-account_statement_import_fr_cfonb"><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/l10n-france&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 the text-based French CFONB bank statements files in Odoo.</p>
<p>The specifications are available on the <a class="reference external" href="https://www.cfonb.org">official CFONB website</a> under the section <em>Espace documentaire &gt; Organisation des échanges &gt; Restituation d’information</em>. The document is named <em>Relevé de compte sur support informatique</em> (<a class="reference external" href="https://www.cfonb.org/fichiers/20130612113947_7_4_Releve_de_Compte_sur_support_informatique_2004_07.pdf">direct link</a>).</p>
<p>Since Odoo v14, multi-account CFONB files are supported. When you import such a file, several bank statements will be generated: one for each bank account.</p>
<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/l10n-france/tree/17.0/account_statement_import_fr_cfonb"><img alt="OCA/l10n-france" src="https://img.shields.io/badge/github-OCA%2Fl10n--france-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-france-17-0/l10n-france-17-0-account_statement_import_fr_cfonb"><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/l10n-france&amp;target_branch=17.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 the text-based French CFONB bank
statements files in Odoo.</p>
<p>The specifications are available on the <a class="reference external" href="https://www.cfonb.org">official CFONB
website</a> under the section <em>Espace
documentaire &gt; Organisation des échanges &gt; Restituation d’information</em>.
The document is named <em>Relevé de compte sur support informatique</em>
(<a class="reference external" href="https://www.cfonb.org/fichiers/20130612113947_7_4_Releve_de_Compte_sur_support_informatique_2004_07.pdf">direct
link</a>).</p>
<p>Since Odoo v14, multi-account CFONB files are supported. When you import
such a file, several bank statements will be generated: one for each
bank account.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand All @@ -387,14 +396,16 @@ <h1 class="title">Import French CFONB Bank Statements</h1>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<p>In the dashboard of the <em>Invoicing</em> menu, click on the button <em>Import Statements</em> on any bank statement journal and follow the instructions of the wizard.</p>
<p>In the dashboard of the <em>Invoicing</em> menu, click on the button <em>Import
Statements</em> on any bank statement journal and follow the instructions of
the wizard.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-france/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/l10n-france/issues/new?body=module:%20account_statement_import_fr_cfonb%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/l10n-france/issues/new?body=module:%20account_statement_import_fr_cfonb%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -414,13 +425,15 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/alexis-via"><img alt="alexis-via" src="https://github.com/alexis-via.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-france/tree/16.0/account_statement_import_fr_cfonb">OCA/l10n-france</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-france/tree/17.0/account_statement_import_fr_cfonb">OCA/l10n-france</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,7 @@ def _parse_file(self, data_file):
# currency fields empty on lines that start with '01' and '07',
# so I give default values in the code for those fields
currency_code = line[16:19] != " " and line[16:19] or "EUR"
account_key = "{}-{}-{}-{}".format(
bank_code,
guichet_code,
account_number,
currency_code,
)
account_key = f"{bank_code}-{guichet_code}-{account_number}-{currency_code}"
decimals = line[19:20] == " " and 2 or int(line[19:20])
# decimals=2 for EUR, 0 for XPF
date_cfonb_str = line[34:40]
Expand Down

0 comments on commit 85dcf12

Please sign in to comment.