From 1b7a7c6ecb9d990f55bd28eba7caeb8337d1b8fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Wed, 6 Sep 2023 12:49:28 +0200 Subject: [PATCH] [IMP] base_tier_validation: Change reviews table TT43351 --- base_tier_validation/__manifest__.py | 2 +- .../i18n/base_tier_validation.pot | 55 ++-------- base_tier_validation/i18n/es.po | 102 ++++-------------- base_tier_validation/models/res_users.py | 1 + .../static/src/js/tier_review_widget.js | 66 ------------ .../static/src/scss/review.scss | 3 +- .../static/src/xml/tier_review_template.xml | 89 --------------- .../templates/tier_validation_templates.xml | 30 +++++- base_tier_validation/views/assets_backend.xml | 4 - .../views/tier_review_view.xml | 12 +++ 10 files changed, 70 insertions(+), 294 deletions(-) delete mode 100644 base_tier_validation/static/src/js/tier_review_widget.js delete mode 100644 base_tier_validation/static/src/xml/tier_review_template.xml diff --git a/base_tier_validation/__manifest__.py b/base_tier_validation/__manifest__.py index 81157a5abe..e8e0d0980a 100644 --- a/base_tier_validation/__manifest__.py +++ b/base_tier_validation/__manifest__.py @@ -24,5 +24,5 @@ "wizard/comment_wizard_view.xml", "templates/tier_validation_templates.xml", ], - "qweb": ["static/src/xml/systray.xml", "static/src/xml/tier_review_template.xml"], + "qweb": ["static/src/xml/systray.xml"], } diff --git a/base_tier_validation/i18n/base_tier_validation.pot b/base_tier_validation/i18n/base_tier_validation.pot index 327b3ad633..d91fa6fc20 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-09-06 11:11+0000\n" +"PO-Revision-Date: 2023-09-06 11:11+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -173,9 +175,7 @@ msgid "Cancel" msgstr "" #. module: base_tier_validation -#. openerp-web #: code:addons/base_tier_validation/models/tier_validation.py:0 -#: code:addons/base_tier_validation/static/src/xml/tier_review_template.xml:0 #: model:ir.model.fields,field_description:base_tier_validation.field_comment_wizard__comment #: model:ir.model.fields,field_description:base_tier_validation.field_tier_definition__has_comment #: model:ir.model.fields,field_description:base_tier_validation.field_tier_review__has_comment @@ -231,11 +231,8 @@ msgid "Definition Domain" msgstr "" #. module: base_tier_validation -#. 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__name #: model:ir.model.fields,field_description:base_tier_validation.field_tier_review__name -#, python-format msgid "Description" msgstr "" @@ -259,13 +256,6 @@ msgstr "" msgid "Done By" msgstr "" -#. module: base_tier_validation -#. openerp-web -#: code:addons/base_tier_validation/static/src/xml/tier_review_template.xml:0 -#, python-format -msgid "Done by" -msgstr "" - #. module: base_tier_validation #: model:ir.model.fields.selection,name:base_tier_validation.selection__tier_definition__review_type__field msgid "Field in related record" @@ -304,16 +294,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 @@ -464,13 +444,6 @@ msgstr "" msgid "Requested By" msgstr "" -#. module: base_tier_validation -#. openerp-web -#: code:addons/base_tier_validation/static/src/xml/tier_review_template.xml:0 -#, python-format -msgid "Requested by" -msgstr "" - #. module: base_tier_validation #: model:ir.model.fields,field_description:base_tier_validation.field_comment_wizard__res_id msgid "Res" @@ -521,18 +494,14 @@ msgstr "" #. module: base_tier_validation #. openerp-web #: code:addons/base_tier_validation/static/src/xml/systray.xml:0 -#: code:addons/base_tier_validation/static/src/xml/tier_review_template.xml:0 #: model:ir.model.fields,field_description:base_tier_validation.field_res_users__review_ids +#: model_terms:ir.ui.view,arch_db:base_tier_validation.tier_validation_reviews #, python-format msgid "Reviews" msgstr "" #. module: base_tier_validation -#. 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 "" @@ -542,10 +511,7 @@ msgid "Specific user" msgstr "" #. module: base_tier_validation -#. 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_review__status -#, python-format msgid "Status" msgstr "" @@ -582,6 +548,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 @@ -662,13 +633,6 @@ msgstr "" msgid "Todo By" msgstr "" -#. module: base_tier_validation -#. openerp-web -#: code:addons/base_tier_validation/static/src/xml/tier_review_template.xml:0 -#, python-format -msgid "Todo by" -msgstr "" - #. module: base_tier_validation #: model:ir.model,name:base_tier_validation.model_res_users msgid "Users" @@ -706,10 +670,7 @@ msgid "Validated by" msgstr "" #. module: base_tier_validation -#. 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_review__reviewed_date -#, python-format msgid "Validation Date" msgstr "" diff --git a/base_tier_validation/i18n/es.po b/base_tier_validation/i18n/es.po index 92f5e6e25b..95409a357d 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-09-06 11:11+0000\n" +"PO-Revision-Date: 2023-09-06 13:12+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 @@ -189,9 +190,7 @@ msgid "Cancel" msgstr "Cancelar" #. module: base_tier_validation -#. openerp-web #: code:addons/base_tier_validation/models/tier_validation.py:0 -#: code:addons/base_tier_validation/static/src/xml/tier_review_template.xml:0 #: model:ir.model.fields,field_description:base_tier_validation.field_comment_wizard__comment #: model:ir.model.fields,field_description:base_tier_validation.field_tier_definition__has_comment #: model:ir.model.fields,field_description:base_tier_validation.field_tier_review__has_comment @@ -218,8 +217,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 @@ -247,11 +247,8 @@ msgid "Definition Domain" msgstr "Dominio de definición" #. module: base_tier_validation -#. 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__name #: model:ir.model.fields,field_description:base_tier_validation.field_tier_review__name -#, python-format msgid "Description" msgstr "Descripción" @@ -275,13 +272,6 @@ msgstr "Dominio" msgid "Done By" msgstr "Hecho Por" -#. module: base_tier_validation -#. openerp-web -#: code:addons/base_tier_validation/static/src/xml/tier_review_template.xml:0 -#, python-format -msgid "Done by" -msgstr "Hecho Por" - #. module: base_tier_validation #: model:ir.model.fields.selection,name:base_tier_validation.selection__tier_definition__review_type__field msgid "Field in related record" @@ -323,16 +313,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 @@ -484,30 +464,23 @@ msgstr "Solicitar validación" msgid "Requested By" msgstr "Solicitado Por" -#. module: base_tier_validation -#. openerp-web -#: code:addons/base_tier_validation/static/src/xml/tier_review_template.xml:0 -#, python-format -msgid "Requested by" -msgstr "Solicitado Por" - #. module: base_tier_validation #: 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 @@ -544,18 +517,14 @@ msgstr "Revisores" #. module: base_tier_validation #. openerp-web #: code:addons/base_tier_validation/static/src/xml/systray.xml:0 -#: code:addons/base_tier_validation/static/src/xml/tier_review_template.xml:0 #: model:ir.model.fields,field_description:base_tier_validation.field_res_users__review_ids +#: model_terms:ir.ui.view,arch_db:base_tier_validation.tier_validation_reviews #, python-format msgid "Reviews" msgstr "Revisiones" #. module: base_tier_validation -#. 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" @@ -565,10 +534,7 @@ msgid "Specific user" msgstr "Usuario específico" #. module: base_tier_validation -#. 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_review__status -#, python-format msgid "Status" msgstr "Estado" @@ -600,11 +566,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 +614,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 @@ -687,13 +660,6 @@ msgstr "" msgid "Todo By" msgstr "" -#. module: base_tier_validation -#. openerp-web -#: code:addons/base_tier_validation/static/src/xml/tier_review_template.xml:0 -#, python-format -msgid "Todo by" -msgstr "" - #. module: base_tier_validation #: model:ir.model,name:base_tier_validation.model_res_users msgid "Users" @@ -706,8 +672,9 @@ msgstr "" #. module: base_tier_validation #: model_terms:ir.ui.view,arch_db:base_tier_validation.tier_validation_label +#, fuzzy msgid "Validate" -msgstr "" +msgstr "Validar" #. module: base_tier_validation #: model:ir.model.fields,field_description:base_tier_validation.field_comment_wizard__validate_reject @@ -732,10 +699,7 @@ msgid "Validated by" msgstr "Validado por" #. module: base_tier_validation -#. 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_review__reviewed_date -#, python-format msgid "Validation Date" msgstr "Fecha de Validación" @@ -748,27 +712,3 @@ msgstr "Validaciones" #: 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/res_users.py b/base_tier_validation/models/res_users.py index 1195446819..21cccb8bb8 100644 --- a/base_tier_validation/models/res_users.py +++ b/base_tier_validation/models/res_users.py @@ -41,6 +41,7 @@ def review_user_count(self): } return list(user_reviews.values()) + # TODO: No longer used. To be removed in v17 @api.model def get_reviews(self, data): review_obj = self.env["tier.review"].with_context(lang=self.env.user.lang) diff --git a/base_tier_validation/static/src/js/tier_review_widget.js b/base_tier_validation/static/src/js/tier_review_widget.js deleted file mode 100644 index 672dfcf151..0000000000 --- a/base_tier_validation/static/src/js/tier_review_widget.js +++ /dev/null @@ -1,66 +0,0 @@ -odoo.define("base_tier_validation.ReviewField", function (require) { - "use strict"; - - var AbstractField = require("web.AbstractField"); - var core = require("web.core"); - var field_registry = require("web.field_registry"); - - var QWeb = core.qweb; - - var ReviewField = AbstractField.extend({ - template: "tier.review.Collapse", - events: { - "click .o_info_btn": "_onButtonClicked", - "show.bs.collapse": "_showCollapse", - "hide.bs.collapse": "_hideCollapse", - }, - start: function () { - var self = this; - self._renderDropdown(); - }, - - /** - * Make RPC and get current user's activity details - * @private - * @param {Object} res_ids - * @returns {integer} - */ - _getReviewData: function (res_ids) { - var self = this; - - return this._rpc({ - model: "res.users", - method: "get_reviews", - args: [res_ids], - }).then(function (data) { - self.reviews = data; - }); - }, - _renderDropdown: function () { - var self = this; - return this._getReviewData(self.value).then(function () { - self.$(".o_review").html( - QWeb.render("tier.review.ReviewsTable", { - reviews: self.reviews, - }) - ); - }); - }, - _onButtonClicked: function (event) { - event.preventDefault(); - if (!this.$el.hasClass("open")) { - this._renderDropdown(); - } - }, - _showCollapse: function () { - this.$el.find(".panel-heading").addClass("active"); - }, - _hideCollapse: function () { - this.$el.find(".panel-heading").removeClass("active"); - }, - }); - - field_registry.add("tier_validation", ReviewField); - - return ReviewField; -}); diff --git a/base_tier_validation/static/src/scss/review.scss b/base_tier_validation/static/src/scss/review.scss index 4342206dce..af0e544e90 100644 --- a/base_tier_validation/static/src/scss/review.scss +++ b/base_tier_validation/static/src/scss/review.scss @@ -26,7 +26,6 @@ ul.o_review { .panel-title > a:active { display: block; } - .panel-heading a:before { font-family: FontAwesome; content: "\f0d7"; @@ -34,7 +33,7 @@ ul.o_review { transition: all 0.5s; } -.panel-heading.active a:before { +.panel-heading a:not(.collapsed):before { -webkit-transform: rotate(180deg); -moz-transform: rotate(180deg); transform: rotate(180deg); diff --git a/base_tier_validation/static/src/xml/tier_review_template.xml b/base_tier_validation/static/src/xml/tier_review_template.xml deleted file mode 100644 index b4114219fd..0000000000 --- a/base_tier_validation/static/src/xml/tier_review_template.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - -
-
- -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SequenceRequested byDescriptionStatusTodo byDone byValidation DateComment
- - - - - - - - - - - - - - - - - - - -
-
- diff --git a/base_tier_validation/templates/tier_validation_templates.xml b/base_tier_validation/templates/tier_validation_templates.xml index bad0539d9f..8e8b42543d 100644 --- a/base_tier_validation/templates/tier_validation_templates.xml +++ b/base_tier_validation/templates/tier_validation_templates.xml @@ -82,10 +82,32 @@
diff --git a/base_tier_validation/views/assets_backend.xml b/base_tier_validation/views/assets_backend.xml index 152093c35b..c4fac7cd4b 100644 --- a/base_tier_validation/views/assets_backend.xml +++ b/base_tier_validation/views/assets_backend.xml @@ -6,10 +6,6 @@ type="text/javascript" src="/base_tier_validation/static/src/js/systray.js" /> -