From 25c06f4ec3b56efbaf1883cfcb7fde5d65dd8890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <30716308+remi-filament@users.noreply.github.com> Date: Mon, 6 Jan 2025 10:01:53 +0100 Subject: [PATCH] [IMP] l10n_fr_siret_lookup: add check for active companies --- l10n_fr_siret_lookup/README.rst | 2 +- l10n_fr_siret_lookup/i18n/es.po | 10 ++++ l10n_fr_siret_lookup/i18n/fr.po | 52 ++++++++----------- .../i18n/l10n_fr_siret_lookup.pot | 12 +++++ l10n_fr_siret_lookup/models/res_partner.py | 1 + l10n_fr_siret_lookup/readme/USAGE.rst | 2 +- .../static/description/index.html | 2 +- .../wizard/fr_siret_lookup.py | 6 ++- .../wizard/fr_siret_lookup_view.xml | 51 +++++++++++------- 9 files changed, 83 insertions(+), 55 deletions(-) diff --git a/l10n_fr_siret_lookup/README.rst b/l10n_fr_siret_lookup/README.rst index d428a1018..869dd95d9 100644 --- a/l10n_fr_siret_lookup/README.rst +++ b/l10n_fr_siret_lookup/README.rst @@ -63,7 +63,7 @@ To update an existing parter, go to the partner form view and click on *Action > 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 companies is displayed. You may want to click on one in order to see corresponding information or directly select company from tree view. Once a company is selected, the partner information is updated and a message is logged in the chatter. Bug Tracker =========== diff --git a/l10n_fr_siret_lookup/i18n/es.po b/l10n_fr_siret_lookup/i18n/es.po index 17c7affdd..20c073f16 100644 --- a/l10n_fr_siret_lookup/i18n/es.po +++ b/l10n_fr_siret_lookup/i18n/es.po @@ -31,6 +31,11 @@ msgstr "Código APE" msgid "APE Label" msgstr "Etiqueta APE" +#. module: l10n_fr_siret_lookup +#: model:ir.model.fields,field_description:l10n_fr_siret_lookup.field_fr_siret_lookup_line__active +msgid "Active" +msgstr "Abierta" + #. module: l10n_fr_siret_lookup #: model_terms:ir.ui.view,arch_db:l10n_fr_siret_lookup.fr_siret_lookup_line_form msgid "Address" @@ -51,6 +56,11 @@ msgstr "Ciudad" msgid "Close" msgstr "Cerrar" +#. module: l10n_fr_siret_lookup +#: model_terms:ir.ui.view,arch_db:l10n_fr_siret_lookup.fr_siret_lookup_line_form +msgid "Closed" +msgstr "Cerrada" + #. module: l10n_fr_siret_lookup #: model_terms:ir.ui.view,arch_db:l10n_fr_siret_lookup.fr_siret_lookup_line_form msgid "Company" diff --git a/l10n_fr_siret_lookup/i18n/fr.po b/l10n_fr_siret_lookup/i18n/fr.po index 5699c211f..8898fa523 100644 --- a/l10n_fr_siret_lookup/i18n/fr.po +++ b/l10n_fr_siret_lookup/i18n/fr.po @@ -1,21 +1,19 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * l10n_fr_siren_lookup +# * l10n_fr_siret_lookup # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-12-04 14:28+0000\n" -"PO-Revision-Date: 2022-09-15 22:07+0000\n" -"Last-Translator: Claude R Perrin \n" +"POT-Creation-Date: 2025-01-06 10:09+0000\n" +"PO-Revision-Date: 2025-01-06 10:09+0000\n" +"Last-Translator: \n" "Language-Team: \n" -"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.3.2\n" +"Plural-Forms: \n" #. module: l10n_fr_siret_lookup #: model:ir.model.fields,field_description:l10n_fr_siret_lookup.field_fr_siret_lookup_line__staff @@ -32,6 +30,11 @@ msgstr "Code NAF" msgid "APE Label" msgstr "Libellé NAF" +#. module: l10n_fr_siret_lookup +#: model:ir.model.fields,field_description:l10n_fr_siret_lookup.field_fr_siret_lookup_line__active +msgid "Active" +msgstr "" + #. module: l10n_fr_siret_lookup #: model_terms:ir.ui.view,arch_db:l10n_fr_siret_lookup.fr_siret_lookup_line_form msgid "Address" @@ -52,6 +55,11 @@ msgstr "Ville" msgid "Close" msgstr "Fermer" +#. module: l10n_fr_siret_lookup +#: model_terms:ir.ui.view,arch_db:l10n_fr_siret_lookup.fr_siret_lookup_line_form +msgid "Closed" +msgstr "Fermée" + #. module: l10n_fr_siret_lookup #: model_terms:ir.ui.view,arch_db:l10n_fr_siret_lookup.fr_siret_lookup_line_form msgid "Company" @@ -76,7 +84,7 @@ msgstr "Valider l'entreprise sélectionnée ?" #. module: l10n_fr_siret_lookup #: model:ir.model,name:l10n_fr_siret_lookup.model_res_partner msgid "Contact" -msgstr "Contact" +msgstr "" #. module: l10n_fr_siret_lookup #: model:ir.model.fields,field_description:l10n_fr_siret_lookup.field_fr_siret_lookup_line__country_id @@ -98,7 +106,7 @@ msgstr "Créé le" #. module: l10n_fr_siret_lookup #: model:ir.model.fields,field_description:l10n_fr_siret_lookup.field_fr_siret_lookup_line__creation_date msgid "Creation Date" -msgstr "" +msgstr "Date de création" #. module: l10n_fr_siret_lookup #: model:ir.model.fields,field_description:l10n_fr_siret_lookup.field_fr_siret_lookup__display_name @@ -137,7 +145,7 @@ msgstr "Obtenir les informations sur les entreprises" #: model:ir.model.fields,field_description:l10n_fr_siret_lookup.field_fr_siret_lookup__id #: model:ir.model.fields,field_description:l10n_fr_siret_lookup.field_fr_siret_lookup_line__id msgid "ID" -msgstr "ID" +msgstr "" #. module: l10n_fr_siret_lookup #: model:ir.model.fields,field_description:l10n_fr_siret_lookup.field_fr_siret_lookup____last_update @@ -210,7 +218,7 @@ msgstr "Résultats" #. module: l10n_fr_siret_lookup #: model:ir.model.fields,field_description:l10n_fr_siret_lookup.field_fr_siret_lookup_line__siren msgid "SIREN" -msgstr "SIREN" +msgstr "" #. module: l10n_fr_siret_lookup #: model:ir.actions.act_window,name:l10n_fr_siret_lookup.fr_siret_lookup_partner_action @@ -230,7 +238,7 @@ msgstr "Recherche SIREN via opendatasoft.com" #. module: l10n_fr_siret_lookup #: model:ir.model.fields,field_description:l10n_fr_siret_lookup.field_fr_siret_lookup_line__siret msgid "SIRET" -msgstr "SIRET" +msgstr "" #. module: l10n_fr_siret_lookup #: model_terms:ir.ui.view,arch_db:l10n_fr_siret_lookup.fr_siret_lookup_form @@ -264,21 +272,3 @@ msgstr "Assistant" #: model:ir.model.fields,field_description:l10n_fr_siret_lookup.field_fr_siret_lookup_line__zip msgid "Zip" msgstr "Code Postal" - -#~ msgid "Creation date" -#~ msgstr "Date de création" - -#~ msgid "CP" -#~ msgstr "CP" - -#~ msgid "Companies Selection" -#~ msgstr "Sélection d'Entreprises" - -#~ msgid "Informations base Siren" -#~ msgstr "Informations base Siren" - -#~ msgid "Lookup Company" -#~ msgstr "Rechercher une Entreprise" - -#~ msgid "Pre-Fill / Update" -#~ msgstr "Pré-Remplir / Mettre à jour" diff --git a/l10n_fr_siret_lookup/i18n/l10n_fr_siret_lookup.pot b/l10n_fr_siret_lookup/i18n/l10n_fr_siret_lookup.pot index 3f4f76ac0..43fcc21d0 100644 --- a/l10n_fr_siret_lookup/i18n/l10n_fr_siret_lookup.pot +++ b/l10n_fr_siret_lookup/i18n/l10n_fr_siret_lookup.pot @@ -6,6 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-01-06 10:08+0000\n" +"PO-Revision-Date: 2025-01-06 10:08+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -28,6 +30,11 @@ msgstr "" msgid "APE Label" msgstr "" +#. module: l10n_fr_siret_lookup +#: model:ir.model.fields,field_description:l10n_fr_siret_lookup.field_fr_siret_lookup_line__active +msgid "Active" +msgstr "" + #. module: l10n_fr_siret_lookup #: model_terms:ir.ui.view,arch_db:l10n_fr_siret_lookup.fr_siret_lookup_line_form msgid "Address" @@ -48,6 +55,11 @@ msgstr "" msgid "Close" msgstr "" +#. module: l10n_fr_siret_lookup +#: model_terms:ir.ui.view,arch_db:l10n_fr_siret_lookup.fr_siret_lookup_line_form +msgid "Closed" +msgstr "" + #. module: l10n_fr_siret_lookup #: model_terms:ir.ui.view,arch_db:l10n_fr_siret_lookup.fr_siret_lookup_line_form msgid "Company" diff --git a/l10n_fr_siret_lookup/models/res_partner.py b/l10n_fr_siret_lookup/models/res_partner.py index 082727718..52172299f 100644 --- a/l10n_fr_siret_lookup/models/res_partner.py +++ b/l10n_fr_siret_lookup/models/res_partner.py @@ -45,6 +45,7 @@ def _opendatasoft_fields_list(self): "divisionunitelegale", "naturejuridiqueunitelegale", "trancheeffectifsunitelegale", + "etatadministratifetablissement", ] @api.model diff --git a/l10n_fr_siret_lookup/readme/USAGE.rst b/l10n_fr_siret_lookup/readme/USAGE.rst index 3a3291f34..4785c72c3 100644 --- a/l10n_fr_siret_lookup/readme/USAGE.rst +++ b/l10n_fr_siret_lookup/readme/USAGE.rst @@ -2,4 +2,4 @@ To update an existing parter, go to the partner form view and click on *Action > 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 companies is displayed. You may want to click on one in order to see corresponding information or directly select company from tree view. Once a company is selected, the partner information is updated and a message is logged in the chatter. diff --git a/l10n_fr_siret_lookup/static/description/index.html b/l10n_fr_siret_lookup/static/description/index.html index b25cac2c4..8f9aa2009 100644 --- a/l10n_fr_siret_lookup/static/description/index.html +++ b/l10n_fr_siret_lookup/static/description/index.html @@ -410,7 +410,7 @@

Installation

Usage

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.

+

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

Bug Tracker

diff --git a/l10n_fr_siret_lookup/wizard/fr_siret_lookup.py b/l10n_fr_siret_lookup/wizard/fr_siret_lookup.py index 63508aff5..1d2f31c12 100644 --- a/l10n_fr_siret_lookup/wizard/fr_siret_lookup.py +++ b/l10n_fr_siret_lookup/wizard/fr_siret_lookup.py @@ -63,6 +63,7 @@ def _prepare_partner_from_data(self, data): "ape_label": data.get("divisionunitelegale"), "legal_type": data.get("naturejuridiqueunitelegale"), "staff": data.get("trancheeffectifsunitelegale", 0), + "active": data.get("etatadministratifetablissement") == "Actif", } def get_lines(self): @@ -78,8 +79,10 @@ def get_lines(self): res = self._prepare_partner_from_data(company["fields"]) companies_vals.append((0, 0, res)) self.line_ids = companies_vals + current_context = dict(self.env.context) + current_context["active_test"] = False return { - "context": self.env.context, + "context": current_context, "view_mode": "form", "res_model": self._name, "res_id": self.id, @@ -107,6 +110,7 @@ class FrSiretLookupLine(models.TransientModel): creation_date = fields.Date() staff = fields.Char("# Staff") category = fields.Char() + active = fields.Boolean() def _prepare_partner_values(self): self.ensure_one() diff --git a/l10n_fr_siret_lookup/wizard/fr_siret_lookup_view.xml b/l10n_fr_siret_lookup/wizard/fr_siret_lookup_view.xml index 91ed6784c..1ceb34443 100644 --- a/l10n_fr_siret_lookup/wizard/fr_siret_lookup_view.xml +++ b/l10n_fr_siret_lookup/wizard/fr_siret_lookup_view.xml @@ -15,31 +15,33 @@ type="object" colspan="2" /> - - - - - - - - - - - - - - - - -