From 5e5c12efbdafa19e3118c589c4f5bf86a466a94c Mon Sep 17 00:00:00 2001 From: Carolina Fernandez Date: Thu, 28 Sep 2023 07:42:40 -0300 Subject: [PATCH] [MIG] contract_price_revision: Migration to 15.0 --- contract_price_revision/README.rst | 13 +++++++------ contract_price_revision/__manifest__.py | 9 +++++++-- .../i18n/contract_price_revision.pot | 2 +- contract_price_revision/i18n/es.po | 14 +++++++------- contract_price_revision/models/contract_line.py | 2 +- contract_price_revision/readme/CONTRIBUTORS.rst | 1 + .../security/ir.model.access.csv | 3 +++ .../static/description/index.html | 9 +++++---- .../tests/test_contract_price_revision.py | 3 ++- .../wizards/contract_price_revision.py | 4 ++-- 10 files changed, 36 insertions(+), 24 deletions(-) create mode 100644 contract_price_revision/security/ir.model.access.csv diff --git a/contract_price_revision/README.rst b/contract_price_revision/README.rst index 008a04f7a..d79af9cf8 100644 --- a/contract_price_revision/README.rst +++ b/contract_price_revision/README.rst @@ -7,7 +7,7 @@ Contract Price Revision !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:c8a59ff02fbb6be23950f10dec81d9fac5d8dceb53a5213a9cce91789ca63230 + !! source digest: sha256:de222a92e86474bc20e85dbdae73adfb5e21bd3f96b065006dcb12b04f58b2ff !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png @@ -17,13 +17,13 @@ Contract Price Revision :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github - :target: https://github.com/OCA/contract/tree/13.0/contract_price_revision + :target: https://github.com/OCA/contract/tree/15.0/contract_price_revision :alt: OCA/contract .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/contract-13-0/contract-13-0-contract_price_revision + :target: https://translation.odoo-community.org/projects/contract-15-0/contract-15-0-contract_price_revision :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/contract&target_branch=13.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/contract&target_branch=15.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -63,7 +63,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -83,6 +83,7 @@ Contributors * Vicent Cubells * Carlos Dauden + * Carolina Fernandez Maintainers ~~~~~~~~~~~ @@ -105,6 +106,6 @@ Current `maintainer `__: |maintainer-carlosdauden| -This module is part of the `OCA/contract `_ project on GitHub. +This module is part of the `OCA/contract `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/contract_price_revision/__manifest__.py b/contract_price_revision/__manifest__.py index 46dbe8da4..85e3ce33e 100644 --- a/contract_price_revision/__manifest__.py +++ b/contract_price_revision/__manifest__.py @@ -1,17 +1,22 @@ # Copyright 2019 Tecnativa - Vicent Cubells # Copyright 2019 Tecnativa - Carlos Dauden +# Copyright 2023 Tecnativa - Carolina Fernandez # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { "name": "Contract Price Revision", "summary": "Easy revision of contract prices", - "version": "13.0.1.0.1", + "version": "15.0.1.0.0", "category": "Contract", "author": "ACSONE SA/NV, Tecnativa, Odoo Community Association (OCA)", "license": "AGPL-3", "website": "https://github.com/OCA/contract", "depends": ["contract"], - "data": ["views/contract_line.xml", "wizards/contract_price_revision_views.xml"], + "data": [ + "security/ir.model.access.csv", + "views/contract_line.xml", + "wizards/contract_price_revision_views.xml", + ], "installable": True, "development_status": "Production/Stable", "maintainers": ["carlosdauden"], diff --git a/contract_price_revision/i18n/contract_price_revision.pot b/contract_price_revision/i18n/contract_price_revision.pot index cf3d27abf..442ca67e2 100644 --- a/contract_price_revision/i18n/contract_price_revision.pot +++ b/contract_price_revision/i18n/contract_price_revision.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" +"Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" diff --git a/contract_price_revision/i18n/es.po b/contract_price_revision/i18n/es.po index deb901a8c..a5cd71f1d 100644 --- a/contract_price_revision/i18n/es.po +++ b/contract_price_revision/i18n/es.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-12-17 12:20+0100\n" -"PO-Revision-Date: 2023-07-20 09:11+0000\n" +"PO-Revision-Date: 2023-10-29 09:38+0000\n" "Last-Translator: Ivorra78 \n" "Language-Team: \n" "Language: es\n" @@ -30,7 +30,7 @@ msgstr "Cancelar" #. module: contract_price_revision #: model:ir.model.fields,help:contract_price_revision.field_contract_line__never_revise_price msgid "Check this if you don't want to allow price revision." -msgstr "" +msgstr "Marque esta casilla si no desea permitir la revisión de precios." #. module: contract_price_revision #: model:ir.model,name:contract_price_revision.model_contract_line @@ -70,7 +70,7 @@ msgstr "Nombre mostrado" #. module: contract_price_revision #: model:ir.model.fields,field_description:contract_price_revision.field_contract_price_revision_wizard__fixed_price msgid "Fixed Price" -msgstr "" +msgstr "Precio Fijo" #. module: contract_price_revision #: model:ir.model.fields,field_description:contract_price_revision.field_contract_price_revision_wizard__id @@ -95,7 +95,7 @@ msgstr "Última actualización en" #. module: contract_price_revision #: model:ir.model.fields,field_description:contract_price_revision.field_contract_line__never_revise_price msgid "Never Revise Price" -msgstr "" +msgstr "No Revisar Nunca el Precio" #. module: contract_price_revision #: model:ir.model.fields,field_description:contract_price_revision.field_contract_line__previous_price @@ -105,7 +105,7 @@ msgstr "Precio anterior" #. module: contract_price_revision #: model:ir.model.fields,field_description:contract_price_revision.field_contract_line__price_can_be_revised msgid "Price Can Be Revised" -msgstr "" +msgstr "El Precio Puede ser Revisado" #. module: contract_price_revision #: model_terms:ir.ui.view,arch_db:contract_price_revision.contract_line_duplicate_wizard_view @@ -125,7 +125,7 @@ msgstr "" #. module: contract_price_revision #: model:ir.model.fields,help:contract_price_revision.field_contract_line__price_can_be_revised msgid "Technical field in order to know if the line price can be revised." -msgstr "" +msgstr "Campo técnico para saber si se puede revisar el precio de la línea." #. module: contract_price_revision #: model:ir.model.fields,field_description:contract_price_revision.field_contract_line__variation_percent @@ -136,7 +136,7 @@ msgstr "Variación %" #. module: contract_price_revision #: model:ir.model.fields,field_description:contract_price_revision.field_contract_price_revision_wizard__variation_type msgid "Variation Type" -msgstr "" +msgstr "Tipo de Variación" #. module: contract_price_revision #: model:ir.model,name:contract_price_revision.model_contract_price_revision_wizard diff --git a/contract_price_revision/models/contract_line.py b/contract_price_revision/models/contract_line.py index 7d33cf3ac..54d566c58 100644 --- a/contract_price_revision/models/contract_line.py +++ b/contract_price_revision/models/contract_line.py @@ -30,7 +30,7 @@ class ContractLine(models.Model): @api.depends_context("date_start") def _compute_price_can_be_revised(self): - date_start = self.env.context.get("date_start", fields.Datetime.now()) + date_start = self.env.context.get("date_start", fields.Date.today()) lines_can_be_revised = self.filtered( lambda line: not line.never_revise_price and not line.automatic_price diff --git a/contract_price_revision/readme/CONTRIBUTORS.rst b/contract_price_revision/readme/CONTRIBUTORS.rst index 1441c9946..8308dec89 100644 --- a/contract_price_revision/readme/CONTRIBUTORS.rst +++ b/contract_price_revision/readme/CONTRIBUTORS.rst @@ -2,3 +2,4 @@ * Vicent Cubells * Carlos Dauden + * Carolina Fernandez diff --git a/contract_price_revision/security/ir.model.access.csv b/contract_price_revision/security/ir.model.access.csv new file mode 100644 index 000000000..db56498c5 --- /dev/null +++ b/contract_price_revision/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_contract_price_revision_wizard_account_invoice,access_contract_price_revision_wizard_account_invoice,model_contract_price_revision_wizard,account.group_account_invoice,1,1,1,1 +access_contract_price_revision_wizard_account_manager,access_contract_price_revision_wizard_account_manager,model_contract_price_revision_wizard,account.group_account_manager,1,1,1,1 diff --git a/contract_price_revision/static/description/index.html b/contract_price_revision/static/description/index.html index 9d8efe21e..e84c03f29 100644 --- a/contract_price_revision/static/description/index.html +++ b/contract_price_revision/static/description/index.html @@ -367,9 +367,9 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:c8a59ff02fbb6be23950f10dec81d9fac5d8dceb53a5213a9cce91789ca63230 +!! source digest: sha256:de222a92e86474bc20e85dbdae73adfb5e21bd3f96b065006dcb12b04f58b2ff !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Production/Stable License: AGPL-3 OCA/contract Translate me on Weblate Try me on Runboat

+

Production/Stable License: AGPL-3 OCA/contract Translate me on Weblate Try me on Runboat

This module allows to create revisions of contract line prices.

Table of contents

@@ -410,7 +410,7 @@ Check ‘Never Revise Price’ on line level to avoid price revisions.

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -428,6 +428,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
  • Tecnativa:
    • Vicent Cubells
    • Carlos Dauden
    • +
    • Carolina Fernandez
  • @@ -441,7 +442,7 @@ mission is to support the collaborative development of Odoo features and promote its widespread use.

    Current maintainer:

    carlosdauden

    -

    This module is part of the OCA/contract project on GitHub.

    +

    This module is part of the OCA/contract project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    diff --git a/contract_price_revision/tests/test_contract_price_revision.py b/contract_price_revision/tests/test_contract_price_revision.py index a5081e727..fb4104fdb 100644 --- a/contract_price_revision/tests/test_contract_price_revision.py +++ b/contract_price_revision/tests/test_contract_price_revision.py @@ -1,6 +1,7 @@ # Copyright 2019 Tecnativa - Vicent Cubells # Copyright 2019 Tecnativa - Carlos Dauden # Copyright 2020 ACSONE SA/NV +# Copyright 2023 Tecnativa - Carolina Fernandez # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo.addons.contract.tests.test_contract import TestContractBase @@ -20,7 +21,7 @@ class TestContractPriceRevision(TestContractBase): ) def execute_wizard(self): - self.wizard.with_context({"active_ids": [self.contract.id]}).action_apply() + self.wizard.with_context(active_ids=self.contract.id).action_apply() def test_contract_price_revision_wizard(self): # This is for checking if this line is not versioned diff --git a/contract_price_revision/wizards/contract_price_revision.py b/contract_price_revision/wizards/contract_price_revision.py index 824b9624f..62d5d5290 100644 --- a/contract_price_revision/wizards/contract_price_revision.py +++ b/contract_price_revision/wizards/contract_price_revision.py @@ -69,8 +69,8 @@ class ContractPriceRevisionWizard(models.TransientModel): line.stop(date_end) new_line = line.copy(self._get_new_line_value(line)) line.update({"successor_contract_line_id": new_line.id}) - action = self.env["ir.actions.act_window"].for_xml_id( - "contract", "action_customer_contract" + action = self.env["ir.actions.act_window"]._for_xml_id( + "contract.action_customer_contract" ) action["domain"] = [("id", "in", active_ids)] return action