Skip to content

Commit

Permalink
[16.0][IMP] Wizard to calculate vies_passed in all partners
Browse files Browse the repository at this point in the history
This is the forward port of #1716

MT-1044 @moduon
  • Loading branch information
EmilioPascual committed Sep 18, 2023
1 parent fe7e107 commit 0dc84e3
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 10 deletions.
28 changes: 27 additions & 1 deletion base_vat_optional_vies/i18n/base_vat_optional_vies.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,27 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 16.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-18 07:12+0000\n"
"PO-Revision-Date: 2023-09-18 07:12+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: base_vat_optional_vies
#: model_terms:ir.ui.view,arch_db:base_vat_optional_vies.res_config_settings_view_form
msgid "Compute check vies"
msgstr ""

#. module: base_vat_optional_vies
#: model:ir.model,name:base_vat_optional_vies.model_res_config_settings
msgid "Config Settings"
msgstr ""

#. module: base_vat_optional_vies
#: model:ir.model,name:base_vat_optional_vies.model_res_partner
msgid "Contact"
Expand All @@ -27,8 +39,22 @@ msgid ""
"Note: the expected format is %(expected_format)s"
msgstr ""

#. module: base_vat_optional_vies
#: model_terms:ir.ui.view,arch_db:base_vat_optional_vies.res_config_settings_view_form
msgid ""
"This process can take a long time. Are you sure you want to start the "
"process?"
msgstr ""

#. module: base_vat_optional_vies
#: model:ir.model.fields,field_description:base_vat_optional_vies.field_res_partner__vies_passed
#: model:ir.model.fields,field_description:base_vat_optional_vies.field_res_users__vies_passed
msgid "VIES validation"
msgstr ""

#. module: base_vat_optional_vies
#. odoo-python
#: code:addons/base_vat_optional_vies/models/res_config_settings.py:0
#, python-format
msgid "Vies passed calculated in %s partners"
msgstr ""
34 changes: 30 additions & 4 deletions base_vat_optional_vies/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,26 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-04-17 10:18+0000\n"
"Last-Translator: gelo joga Rodríguez <[email protected]>\n"
"POT-Creation-Date: 2023-09-18 07:12+0000\n"
"PO-Revision-Date: 2023-09-18 09:17+0200\n"
"Last-Translator: Emilio Pascual <[email protected]>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.14.1\n"
"X-Generator: Poedit 3.3.1\n"

#. module: base_vat_optional_vies
#: model_terms:ir.ui.view,arch_db:base_vat_optional_vies.res_config_settings_view_form
msgid "Compute check vies"
msgstr "Calcular comprobación VIES"

#. module: base_vat_optional_vies
#: model:ir.model,name:base_vat_optional_vies.model_res_config_settings
msgid "Config Settings"
msgstr "Opciones de configuración"

#. module: base_vat_optional_vies
#: model:ir.model,name:base_vat_optional_vies.model_res_partner
Expand All @@ -33,8 +44,23 @@ msgstr ""
"El NIF [%(wrong_vat)s] para %(record_label)s parece no ser válido. \n"
"Nota: El formato esperado es %(expected_format)s"

#. module: base_vat_optional_vies
#: model_terms:ir.ui.view,arch_db:base_vat_optional_vies.res_config_settings_view_form
msgid ""
"This process can take a long time. Are you sure you want to start the "
"process?"
msgstr ""
"Este proceso puede tardar. ¿Está seguro que quiere iniciar el proceso?"

#. module: base_vat_optional_vies
#: model:ir.model.fields,field_description:base_vat_optional_vies.field_res_partner__vies_passed
#: model:ir.model.fields,field_description:base_vat_optional_vies.field_res_users__vies_passed
msgid "VIES validation"
msgstr "Validación automática VIES"

#. module: base_vat_optional_vies
#. odoo-python
#: code:addons/base_vat_optional_vies/models/res_config_settings.py:0
#, python-format
msgid "Vies passed calculated in %s partners"
msgstr "Validación automática VIES calculada para %s contactos"
8 changes: 3 additions & 5 deletions base_vat_optional_vies/models/res_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ class ResConfigSettings(models.TransientModel):

def execute_update_check_vies(self):
# Only parent partners, children are synced from parent
count_partners = self.env["res.partner"].search_count(
[("parent_id", "=", False)]
)
self.env["res.partner"].search([("parent_id", "=", False)]).check_vat()
count_partners = self.env["res.partner"].search_count([])
self.env["res.partner"].search([]).check_vat()
return {

Check warning on line 14 in base_vat_optional_vies/models/res_config_settings.py

View check run for this annotation

Codecov / codecov/patch

base_vat_optional_vies/models/res_config_settings.py#L12-L14

Added lines #L12 - L14 were not covered by tests
"effect": {
"fadeout": "slow",
"message": _("Vies passed calculated in %s partners") % count_partners,
"img_url": "/web/static/src/img/smile.svg",
"img_url": "/web/static/img/smile.svg",
"type": "rainbow_man",
}
}

0 comments on commit 0dc84e3

Please sign in to comment.