diff --git a/base_tier_validation/i18n/base_tier_validation.pot b/base_tier_validation/i18n/base_tier_validation.pot index 327b3ad633..6089aa2055 100644 --- a/base_tier_validation/i18n/base_tier_validation.pot +++ b/base_tier_validation/i18n/base_tier_validation.pot @@ -6,6 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-10-17 15:04+0000\n" +"PO-Revision-Date: 2023-10-17 15:04+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -304,16 +306,6 @@ msgid "" "definition is triggered." msgstr "" -#. module: base_tier_validation -#: model:ir.model.fields,field_description:base_tier_validation.field_tier_definition__archive_uid -msgid "Last Archived by" -msgstr "" - -#. module: base_tier_validation -#: model:ir.model.fields,field_description:base_tier_validation.field_tier_definition__archive_date -msgid "Last Archived on" -msgstr "" - #. module: base_tier_validation #: model:ir.model.fields,field_description:base_tier_validation.field_comment_wizard____last_update #: model:ir.model.fields,field_description:base_tier_validation.field_res_config_settings____last_update @@ -419,6 +411,7 @@ msgstr "" #. openerp-web #: code:addons/base_tier_validation/static/src/xml/systray.xml:0 #: model:ir.model.fields.selection,name:base_tier_validation.selection__tier_review__status__pending +#: model:ir.model.fields.selection,name:base_tier_validation.selection__tier_validation__validation_status__pending #, python-format msgid "Pending" msgstr "" @@ -436,6 +429,7 @@ msgstr "" #. module: base_tier_validation #: model:ir.model.fields,field_description:base_tier_validation.field_tier_validation__rejected #: model:ir.model.fields.selection,name:base_tier_validation.selection__tier_review__status__rejected +#: model:ir.model.fields.selection,name:base_tier_validation.selection__tier_validation__validation_status__rejected msgid "Rejected" msgstr "" @@ -531,7 +525,6 @@ msgstr "" #. openerp-web #: code:addons/base_tier_validation/static/src/xml/tier_review_template.xml:0 #: model:ir.model.fields,field_description:base_tier_validation.field_tier_definition__sequence -#: model:ir.model.fields,field_description:base_tier_validation.field_tier_review__sequence #, python-format msgid "Sequence" msgstr "" @@ -582,6 +575,11 @@ msgid "" "Please request a validation." msgstr "" +#. module: base_tier_validation +#: model:ir.model.fields,field_description:base_tier_validation.field_tier_review__sequence +msgid "Tier" +msgstr "" + #. module: base_tier_validation #: model:ir.actions.act_window,name:base_tier_validation.tier_definition_action #: model:ir.model,name:base_tier_validation.model_tier_definition @@ -691,6 +689,7 @@ msgstr "" #. module: base_tier_validation #: model:ir.model.fields,field_description:base_tier_validation.field_tier_validation__validated +#: model:ir.model.fields.selection,name:base_tier_validation.selection__tier_validation__validation_status__validated msgid "Validated" msgstr "" @@ -713,11 +712,21 @@ msgstr "" msgid "Validation Date" msgstr "" +#. module: base_tier_validation +#: model:ir.model.fields,field_description:base_tier_validation.field_tier_validation__validation_status +msgid "Validation Status" +msgstr "" + #. module: base_tier_validation #: model:ir.model.fields,field_description:base_tier_validation.field_tier_validation__review_ids msgid "Validations" msgstr "" +#. module: base_tier_validation +#: model:ir.model.fields.selection,name:base_tier_validation.selection__tier_validation__validation_status__no +msgid "Without validation" +msgstr "" + #. module: base_tier_validation #: model_terms:ir.ui.view,arch_db:base_tier_validation.tier_definition_view_form msgid "e.g. Tier Validation for..." diff --git a/base_tier_validation/i18n/es.po b/base_tier_validation/i18n/es.po index 92f5e6e25b..c986af8ee1 100644 --- a/base_tier_validation/i18n/es.po +++ b/base_tier_validation/i18n/es.po @@ -6,15 +6,16 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2021-03-16 11:46+0000\n" +"POT-Creation-Date: 2023-10-17 15:04+0000\n" +"PO-Revision-Date: 2023-10-17 17:06+0200\n" "Last-Translator: Ana Suárez \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.3.2\n" +"X-Generator: Poedit 3.0.1\n" #. module: base_tier_validation #. openerp-web @@ -218,8 +219,9 @@ msgstr "Compañía" #. module: base_tier_validation #: model:ir.model,name:base_tier_validation.model_res_config_settings +#, fuzzy msgid "Config Settings" -msgstr "" +msgstr "Ajustes de configuración" #. module: base_tier_validation #: model:ir.model.fields,field_description:base_tier_validation.field_comment_wizard__create_uid @@ -323,16 +325,6 @@ msgstr "" "Si está establecido, todos los posibles validadores serán notificados por " "email cuando esta definición se ejecute." -#. module: base_tier_validation -#: model:ir.model.fields,field_description:base_tier_validation.field_tier_definition__archive_uid -msgid "Last Archived by" -msgstr "" - -#. module: base_tier_validation -#: model:ir.model.fields,field_description:base_tier_validation.field_tier_definition__archive_date -msgid "Last Archived on" -msgstr "" - #. module: base_tier_validation #: model:ir.model.fields,field_description:base_tier_validation.field_comment_wizard____last_update #: model:ir.model.fields,field_description:base_tier_validation.field_res_config_settings____last_update @@ -439,6 +431,7 @@ msgstr "" #. openerp-web #: code:addons/base_tier_validation/static/src/xml/systray.xml:0 #: model:ir.model.fields.selection,name:base_tier_validation.selection__tier_review__status__pending +#: model:ir.model.fields.selection,name:base_tier_validation.selection__tier_validation__validation_status__pending #, python-format msgid "Pending" msgstr "Pendiente" @@ -456,6 +449,7 @@ msgstr "Rechazar" #. module: base_tier_validation #: model:ir.model.fields,field_description:base_tier_validation.field_tier_validation__rejected #: model:ir.model.fields.selection,name:base_tier_validation.selection__tier_review__status__rejected +#: model:ir.model.fields.selection,name:base_tier_validation.selection__tier_validation__validation_status__rejected msgid "Rejected" msgstr "Rechazado" @@ -495,19 +489,19 @@ msgstr "Solicitado Por" #: model:ir.model.fields,field_description:base_tier_validation.field_comment_wizard__res_id #, fuzzy msgid "Res" -msgstr "Revisiones" +msgstr "Historial de límite de crédito de contacto" #. module: base_tier_validation #: model:ir.model.fields,field_description:base_tier_validation.field_comment_wizard__res_model #, fuzzy msgid "Res Model" -msgstr "Modelo" +msgstr "Res model" #. module: base_tier_validation #: model_terms:ir.ui.view,arch_db:base_tier_validation.tier_validation_buttons #, fuzzy msgid "Restart Validation" -msgstr "Volver a empezar validación" +msgstr "Reiniciar Validación" #. module: base_tier_validation #. openerp-web @@ -554,7 +548,6 @@ msgstr "Revisiones" #. openerp-web #: code:addons/base_tier_validation/static/src/xml/tier_review_template.xml:0 #: model:ir.model.fields,field_description:base_tier_validation.field_tier_definition__sequence -#: model:ir.model.fields,field_description:base_tier_validation.field_tier_review__sequence #, python-format msgid "Sequence" msgstr "Secuencia" @@ -600,11 +593,17 @@ msgstr "" #: code:addons/base_tier_validation/models/tier_validation.py:0 #, python-format msgid "" -"This action needs to be validated for at least one record. Reviews pending:\n" +"This action needs to be validated for at least one record. Reviews " +"pending:\n" " - %s \n" "Please request a validation." msgstr "" +#. module: base_tier_validation +#: model:ir.model.fields,field_description:base_tier_validation.field_tier_review__sequence +msgid "Tier" +msgstr "Nivel" + #. module: base_tier_validation #: model:ir.actions.act_window,name:base_tier_validation.tier_definition_action #: model:ir.model,name:base_tier_validation.model_tier_definition @@ -642,8 +641,9 @@ msgstr "" #. module: base_tier_validation #: model_terms:ir.ui.view,arch_db:base_tier_validation.res_config_settings_view_form_budget +#, fuzzy msgid "Tier Validation" -msgstr "" +msgstr "Nueva Validación de Nivel" #. module: base_tier_validation #: model:ir.model,name:base_tier_validation.model_tier_validation @@ -707,7 +707,7 @@ msgstr "" #. module: base_tier_validation #: model_terms:ir.ui.view,arch_db:base_tier_validation.tier_validation_label msgid "Validate" -msgstr "" +msgstr "Validado" #. module: base_tier_validation #: model:ir.model.fields,field_description:base_tier_validation.field_comment_wizard__validate_reject @@ -717,6 +717,7 @@ msgstr "Validado" #. module: base_tier_validation #: model:ir.model.fields,field_description:base_tier_validation.field_tier_validation__validated +#: model:ir.model.fields.selection,name:base_tier_validation.selection__tier_validation__validation_status__validated msgid "Validated" msgstr "Validado" @@ -739,36 +740,22 @@ msgstr "Validado por" msgid "Validation Date" msgstr "Fecha de Validación" +#. module: base_tier_validation +#: model:ir.model.fields,field_description:base_tier_validation.field_tier_validation__validation_status +msgid "Validation Status" +msgstr "Estado de validación" + #. module: base_tier_validation #: model:ir.model.fields,field_description:base_tier_validation.field_tier_validation__review_ids msgid "Validations" msgstr "Validaciones" +#. module: base_tier_validation +#: model:ir.model.fields.selection,name:base_tier_validation.selection__tier_validation__validation_status__no +msgid "Without validation" +msgstr "Sin validación" + #. module: base_tier_validation #: model_terms:ir.ui.view,arch_db:base_tier_validation.tier_definition_view_form msgid "e.g. Tier Validation for..." msgstr "ej. Validación de Nivel por..." - -#~ msgid "" -#~ "This action needs to be validated for at least one record. \n" -#~ "Please request a validation." -#~ msgstr "" -#~ "Esta acción necesita ser validada para algún registro.\n" -#~ "Por favor, solicita una validación." - -#~ msgid "Any user in a specific group." -#~ msgstr "Cualquier usuario en el grupo especificado." - -#~ msgid "Tier" -#~ msgstr "Nivel" - -#, fuzzy -#~| msgid "Sequence" -#~ msgid "Approve Sequence" -#~ msgstr "Secuencia" - -#~ msgid "Formula" -#~ msgstr "Fórmula" - -#~ msgid "Python Expression" -#~ msgstr "Expresión Python" diff --git a/base_tier_validation/models/tier_validation.py b/base_tier_validation/models/tier_validation.py index b79b0f437d..b041e07cc4 100644 --- a/base_tier_validation/models/tier_validation.py +++ b/base_tier_validation/models/tier_validation.py @@ -31,15 +31,28 @@ class TierValidation(models.AbstractModel): auto_join=True, ) to_validate_message = fields.Html(compute="_compute_validated_rejected") + # TODO: Delete in v17 in favor of validation_status field validated = fields.Boolean( compute="_compute_validated_rejected", search="_search_validated" ) validated_message = fields.Html(compute="_compute_validated_rejected") need_validation = fields.Boolean(compute="_compute_need_validation") + # TODO: Delete in v17 in favor of validation_status field rejected = fields.Boolean( compute="_compute_validated_rejected", search="_search_rejected" ) rejected_message = fields.Html(compute="_compute_validated_rejected") + # Informative field (used in purchase_tier_validation), will be reliable as of v17 + validation_status = fields.Selection( + selection=[ + ("no", "Without validation"), + ("pending", "Pending"), + ("rejected", "Rejected"), + ("validated", "Validated"), + ], + default="no", + compute="_compute_validation_status", + ) reviewer_ids = fields.Many2many( string="Reviewers", comodel_name="res.users", @@ -171,6 +184,21 @@ def _compute_validated_rejected(self): rec.rejected_message = rec._get_rejected_message() rec.to_validate_message = rec._get_to_validate_message() + def _compute_validation_status(self): + for item in self: + if item.validated and not item.rejected: + item.validation_status = "validated" + elif not item.validated and item.rejected: + item.validation_status = "rejected" + elif ( + not item.validated + and not item.rejected + and any(item.review_ids.filtered(lambda x: x.status == "pending")) + ): + item.validation_status = "pending" + else: + item.validation_status = "no" + def _compute_next_review(self): for rec in self: review = rec.review_ids.sorted("sequence").filtered(