Skip to content

Commit

Permalink
[MIG] l10n_fr_siret_lookup: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericgrall committed Oct 30, 2024
1 parent 41ecc6a commit 8535c72
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions l10n_fr_siret_lookup/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Contributors
- Benjamin Rivier <benjamin-filament> (https://le-filament.com)
- Remi Cazenave <remi-filament> (https://le-filament.com)
- Alexis de Lattre <alexis.delattre@akretion.com>
- Frederic Grall <fgr@apik.cloud>

Other credits
-------------
Expand Down
12 changes: 6 additions & 6 deletions l10n_fr_siret_lookup/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _opendatasoft_get_raw_data(
# So I now set exclude_dead=False by default
if exclude_dead:
params["q"] += (
" AND #null(datefermetureetablissement) AND #null(datefermetureunitelegale)"
" AND #null(datefermetureetablissement) AND #null(datefermetureunitelegale)" # noqa: E501
)
try:
logger.info("Sending query to https://data.opendatasoft.com/api")
Expand Down Expand Up @@ -169,14 +169,14 @@ def _opendatasoft_compute_country(self, zipcode):
and len(zipcode) == 5
and zipcode[:3] in domtom2xmlid
):
country_xmlid = "base.%s" % domtom2xmlid[zipcode[:3]]
country_xmlid = f"base.{domtom2xmlid[zipcode[:3]]}"
country_id = self.env.ref(country_xmlid).id
return country_id

@api.model
def _siren2vat_vies(self, siren, raise_if_fail=False):
vat = "FR%s" % siren_to_vat(siren)
logger.info("VIES check of VAT %s" % vat)
vat = f"FR{siren_to_vat(siren)}"
logger.info("VIES check of VAT %s", vat)
vies_res = False
res = False
try:
Expand Down Expand Up @@ -213,7 +213,7 @@ def _opendatasoft_get_first_result(
def _opendatasoft_get_from_siren(self, siren, vat_vies_query=True):
if siren and siren_is_valid(siren):
vals = self._opendatasoft_get_first_result(
"siren:%s AND etablissementsiege:oui" % siren,
f"siren:{siren} AND etablissementsiege:oui",
vat_vies_query=vat_vies_query,
)
if vals and vals.get("siren") == siren:
Expand All @@ -224,7 +224,7 @@ def _opendatasoft_get_from_siren(self, siren, vat_vies_query=True):
def _opendatasoft_get_from_siret(self, siret, vat_vies_query=True):
if siret and siret_is_valid(siret):
vals = self._opendatasoft_get_first_result(
"siret:%s" % siret, vat_vies_query=vat_vies_query
f"siret:{siret}", vat_vies_query=vat_vies_query
)
if vals and vals.get("siren") and vals.get("nic"):
vals_siret = vals["siren"] + vals["nic"]
Expand Down
1 change: 1 addition & 0 deletions l10n_fr_siret_lookup/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Benjamin Rivier \<benjamin-filament\> (<https://le-filament.com>)
- Remi Cazenave \<remi-filament\> (<https://le-filament.com>)
- Alexis de Lattre \<<alexis.delattre@akretion.com>\>
- Frederic Grall \<<fgr@apik.cloud>>
1 change: 1 addition & 0 deletions l10n_fr_siret_lookup/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<li>Benjamin Rivier &lt;benjamin-filament&gt; (<a class="reference external" href="https://le-filament.com">https://le-filament.com</a>)</li>
<li>Remi Cazenave &lt;remi-filament&gt; (<a class="reference external" href="https://le-filament.com">https://le-filament.com</a>)</li>
<li>Alexis de Lattre &lt;<a class="reference external" href="mailto:alexis.delattre&#64;akretion.com">alexis.delattre&#64;akretion.com</a>&gt;</li>
<li>Frederic Grall &lt;<a class="reference external" href="mailto:fgr&#64;apik.cloud">fgr&#64;apik.cloud</a>&gt;</li>
</ul>
</div>
<div class="section" id="other-credits">
Expand Down

0 comments on commit 8535c72

Please sign in to comment.