Skip to content

Commit

Permalink
[IMP] l10n_fr_siret_lookup: pre-commit auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Luis-Mora committed Apr 25, 2024
1 parent 39e4f2c commit cf72108
Show file tree
Hide file tree
Showing 12 changed files with 115 additions and 62 deletions.
70 changes: 43 additions & 27 deletions l10n_fr_siret_lookup/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,44 @@ SIRET Lookup
: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/l10n_fr_siret_lookup
:target: https://github.com/OCA/l10n-france/tree/17.0/l10n_fr_siret_lookup
: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-l10n_fr_siret_lookup
:target: https://translation.odoo-community.org/projects/l10n-france-17-0/l10n-france-17-0-l10n_fr_siret_lookup
: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 modules updates partner fields via the `SIRENE database <https://data.opendatasoft.com>`. It uses the dataset *economicref-france-sirene-v3* of `opendatasoft <https://public.opendatasoft.com/explore/dataset/economicref-france-sirene-v3/information/>`. It computes a theorical VAT number from the SIREN and then checks the validity of the VAT number on `VIES <https://ec.europa.eu/taxation_customs/vies/>`_ (if invalid, the VAT number is discarded).
This modules updates partner fields via the SIRENE database
<`https://data.opendatasoft.com\\> <https://data.opendatasoft.com\>>`__.
It uses the dataset *economicref-france-sirene-v3* of opendatasoft
<`https://public.opendatasoft.com/explore/dataset/economicref-france-sirene-v3/information/\\> <https://public.opendatasoft.com/explore/dataset/economicref-france-sirene-v3/information/\>>`__.
It computes a theorical VAT number from the SIREN and then checks the
validity of the VAT number on
`VIES <https://ec.europa.eu/taxation_customs/vies/>`__ (if invalid, the
VAT number is discarded).

The module supports 2 scenarios:

* update of an existing partner via the menu *Action > SIREN Lookup*,
* creation of a new partner: start by setting the VAT number field, the SIREN field or SIRET field and Odoo will set the other fields. For usability purposes, it also work when you write the VAT number, SIREN or SIRET in the company name field.
- update of an existing partner via the menu *Action > SIREN Lookup*,
- creation of a new partner: start by setting the VAT number field, the
SIREN field or SIRET field and Odoo will set the other fields. For
usability purposes, it also work when you write the VAT number, SIREN
or SIRET in the company name field.

In the 2 scenarios, it will update the following fields:

* Company Name
* Street
* Postal Code
* City
* Country
* SIREN and NIC (i.e. SIRET)
* VAT Number
* Language (creation scenario only)
- Company Name
- Street
- Postal Code
- City
- Country
- SIREN and NIC (i.e. SIRET)
- VAT Number
- Language (creation scenario only)

**Table of contents**

Expand All @@ -54,47 +64,53 @@ In the 2 scenarios, it will update the following fields:
Usage
=====

To update an existing parter, go to the partner form view and click on *Action > SIREN Lookup*.
To update an existing parter, go to the partner form view and click on
*Action > SIREN Lookup*.

By default, the search field is filled with Company name. To get more accurate results, you may want to add the City name where the company is registered. Then click on *Lookup*.
By default, the search field is filled with Company name. To get more
accurate results, you may want to add the City name where the company is
registered. Then click on *Lookup*.

A list of company is displayed. You may want to click on one in order to see corresponding information or directly selecting company from tree view. Once a company is selected, the partner information is updated and a message is logged in the chatter.
A list of company is displayed. You may want to click on one in order to
see corresponding information or directly selecting company from tree
view. Once a company is selected, the partner information is updated and
a message is logged in the chatter.

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:%20l10n_fr_siret_lookup%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:%20l10n_fr_siret_lookup%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
~~~~~~~
-------

* Le Filament
* Akretion

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

* Benjamin Rivier <benjamin-filament> (https://le-filament.com)
* Remi Cazenave <remi-filament> (https://le-filament.com)
* Alexis de Lattre <[email protected]>
- Benjamin Rivier <benjamin-filament> (https://le-filament.com)
- Remi Cazenave <remi-filament> (https://le-filament.com)
- Alexis de Lattre <[email protected]>

Other credits
~~~~~~~~~~~~~
-------------

The development of this module has been financially supported by:

* Le Filament
- Le Filament

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

This module is maintained by the OCA.

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

|maintainer-remi-filament| |maintainer-alexis-via|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 2 additions & 1 deletion l10n_fr_siret_lookup/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
logger = logging.getLogger(__name__)
try:
from stdnum.eu.vat import check_vies
from stdnum.fr.siren import is_valid as siren_is_valid, to_tva as siren_to_vat
from stdnum.fr.siren import is_valid as siren_is_valid
from stdnum.fr.siren import to_tva as siren_to_vat
from stdnum.fr.siret import is_valid as siret_is_valid
except ImportError:
logger.debug("Cannot import stdnum")
Expand Down
3 changes: 3 additions & 0 deletions l10n_fr_siret_lookup/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions l10n_fr_siret_lookup/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Benjamin Rivier \<benjamin-filament\> (<https://le-filament.com>)
- Remi Cazenave \<remi-filament\> (<https://le-filament.com>)
- Alexis de Lattre \<<[email protected]>\>
3 changes: 0 additions & 3 deletions l10n_fr_siret_lookup/readme/CONTRIBUTORS.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
The development of this module has been financially supported by:

* Le Filament
- Le Filament
27 changes: 27 additions & 0 deletions l10n_fr_siret_lookup/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
This modules updates partner fields via the SIRENE database
\<https://data.opendatasoft.com\>. It uses the dataset
*economicref-france-sirene-v3* of opendatasoft
\<https://public.opendatasoft.com/explore/dataset/economicref-france-sirene-v3/information/\>.
It computes a theorical VAT number from the SIREN and then checks the
validity of the VAT number on
[VIES](https://ec.europa.eu/taxation_customs/vies/) (if invalid, the VAT
number is discarded).

The module supports 2 scenarios:

- update of an existing partner via the menu *Action \> SIREN Lookup*,
- creation of a new partner: start by setting the VAT number field, the
SIREN field or SIRET field and Odoo will set the other fields. For
usability purposes, it also work when you write the VAT number, SIREN
or SIRET in the company name field.

In the 2 scenarios, it will update the following fields:

- Company Name
- Street
- Postal Code
- City
- Country
- SIREN and NIC (i.e. SIRET)
- VAT Number
- Language (creation scenario only)
17 changes: 0 additions & 17 deletions l10n_fr_siret_lookup/readme/DESCRIPTION.rst

This file was deleted.

11 changes: 11 additions & 0 deletions l10n_fr_siret_lookup/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
To update an existing parter, go to the partner form view and click on
*Action \> SIREN Lookup*.

By default, the search field is filled with Company name. To get more
accurate results, you may want to add the City name where the company is
registered. Then click on *Lookup*.

A list of company is displayed. You may want to click on one in order to
see corresponding information or directly selecting company from tree
view. Once a company is selected, the partner information is updated and
a message is logged in the chatter.
5 changes: 0 additions & 5 deletions l10n_fr_siret_lookup/readme/USAGE.rst

This file was deleted.

32 changes: 24 additions & 8 deletions l10n_fr_siret_lookup/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,22 @@ <h1 class="title">SIRET Lookup</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:03fba67efc8266229377bb6b509fc696ca15a5c46eef0db0a8d749d51c7d7cdd
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/l10n_fr_siret_lookup"><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-l10n_fr_siret_lookup"><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 modules updates partner fields via the <cite>SIRENE database &lt;https://data.opendatasoft.com&gt;</cite>. It uses the dataset <em>economicref-france-sirene-v3</em> of <cite>opendatasoft &lt;https://public.opendatasoft.com/explore/dataset/economicref-france-sirene-v3/information/&gt;</cite>. It computes a theorical VAT number from the SIREN and then checks the validity of the VAT number on <a class="reference external" href="https://ec.europa.eu/taxation_customs/vies/">VIES</a> (if invalid, the VAT number is discarded).</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/l10n_fr_siret_lookup"><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-l10n_fr_siret_lookup"><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 modules updates partner fields via the SIRENE database
&lt;<a class="reference external" href="https://data.opendatasoft.com&gt;">https://data.opendatasoft.com\&gt;</a>.
It uses the dataset <em>economicref-france-sirene-v3</em> of opendatasoft
&lt;<a class="reference external" href="https://public.opendatasoft.com/explore/dataset/economicref-france-sirene-v3/information/&gt;">https://public.opendatasoft.com/explore/dataset/economicref-france-sirene-v3/information/\&gt;</a>.
It computes a theorical VAT number from the SIREN and then checks the
validity of the VAT number on
<a class="reference external" href="https://ec.europa.eu/taxation_customs/vies/">VIES</a> (if invalid, the
VAT number is discarded).</p>
<p>The module supports 2 scenarios:</p>
<ul class="simple">
<li>update of an existing partner via the menu <em>Action &gt; SIREN Lookup</em>,</li>
<li>creation of a new partner: start by setting the VAT number field, the SIREN field or SIRET field and Odoo will set the other fields. For usability purposes, it also work when you write the VAT number, SIREN or SIRET in the company name field.</li>
<li>creation of a new partner: start by setting the VAT number field, the
SIREN field or SIRET field and Odoo will set the other fields. For
usability purposes, it also work when you write the VAT number, SIREN
or SIRET in the company name field.</li>
</ul>
<p>In the 2 scenarios, it will update the following fields:</p>
<ul class="simple">
Expand Down Expand Up @@ -403,16 +413,22 @@ <h1 class="title">SIRET Lookup</h1>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<p>To update an existing parter, go to the partner form view and click on <em>Action &gt; SIREN Lookup</em>.</p>
<p>By default, the search field is filled with Company name. To get more accurate results, you may want to add the City name where the company is registered. Then click on <em>Lookup</em>.</p>
<p>A list of company is displayed. You may want to click on one in order to see corresponding information or directly selecting company from tree view. Once a company is selected, the partner information is updated and a message is logged in the chatter.</p>
<p>To update an existing parter, go to the partner form view and click on
<em>Action &gt; SIREN Lookup</em>.</p>
<p>By default, the search field is filled with Company name. To get more
accurate results, you may want to add the City name where the company is
registered. Then click on <em>Lookup</em>.</p>
<p>A list of company is displayed. You may want to click on one in order to
see corresponding information or directly selecting company from tree
view. Once a company is selected, the partner information is updated and
a message is logged in the chatter.</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:%20l10n_fr_siret_lookup%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:%20l10n_fr_siret_lookup%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 Down Expand Up @@ -448,7 +464,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/remi-filament"><img alt="remi-filament" src="https://github.com/remi-filament.png?size=40px" /></a> <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/l10n_fr_siret_lookup">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/l10n_fr_siret_lookup">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
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
pyfrdas2
python-stdnum
python-stdnum>=1.18
requests
requests_oauthlib
unidecode

0 comments on commit cf72108

Please sign in to comment.