From c08d4ba4857e07e5b0b92c5a6ec5d727b81a7f2e Mon Sep 17 00:00:00 2001 From: Bhavesh Heliconia Date: Fri, 14 Feb 2025 15:46:34 +0530 Subject: [PATCH] [MIG] account_move_reconcile_forbid_cancel: Migration to 18.0 --- account_move_reconcile_forbid_cancel/README.rst | 4 ++++ account_move_reconcile_forbid_cancel/__manifest__.py | 2 +- .../models/account_move.py | 8 +++++--- .../readme/CONTRIBUTORS.md | 2 ++ .../static/description/index.html | 4 ++++ .../tests/test_account_move_reconcile_forbid_cancel.py | 6 ++++-- 6 files changed, 20 insertions(+), 6 deletions(-) diff --git a/account_move_reconcile_forbid_cancel/README.rst b/account_move_reconcile_forbid_cancel/README.rst index 14dba84f..acf3e24e 100644 --- a/account_move_reconcile_forbid_cancel/README.rst +++ b/account_move_reconcile_forbid_cancel/README.rst @@ -73,6 +73,10 @@ Contributors - Ernesto Tejeda - Pedro M. Baeza +- `Heliconia Solutions Pvt. Ltd. `__ + + - Bhavesh Heliconia + Maintainers ----------- diff --git a/account_move_reconcile_forbid_cancel/__manifest__.py b/account_move_reconcile_forbid_cancel/__manifest__.py index 5b3e94a5..e6c8a493 100644 --- a/account_move_reconcile_forbid_cancel/__manifest__.py +++ b/account_move_reconcile_forbid_cancel/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Account Move Reconcile Forbid Cancel", - "version": "16.0.1.0.1", + "version": "18.0.1.0.0", "category": "Finance", "website": "https://github.com/OCA/account-reconcile", "author": "Tecnativa, Odoo Community Association (OCA)", diff --git a/account_move_reconcile_forbid_cancel/models/account_move.py b/account_move_reconcile_forbid_cancel/models/account_move.py index 539ae708..0829e983 100644 --- a/account_move_reconcile_forbid_cancel/models/account_move.py +++ b/account_move_reconcile_forbid_cancel/models/account_move.py @@ -1,7 +1,7 @@ # Copyright 2022 Tecnativa - Ernesto Tejeda # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo import _, models, tools +from odoo import models, tools from odoo.exceptions import ValidationError @@ -15,7 +15,7 @@ class AccountMove(models.Model): ): if self._get_reconciled_amls(): raise ValidationError( - _("You cannot reset to draft reconciled entries.") + self.env._("You cannot reset to draft reconciled entries.") ) return super().button_draft() @@ -25,5 +25,7 @@ class AccountMove(models.Model): or self.env.context.get("test_reconcile_forbid_cancel") ): if self._get_reconciled_amls(): - raise ValidationError(_("You cannot cancel reconciled entries.")) + raise ValidationError( + self.env._("You cannot cancel reconciled entries.") + ) return super().button_cancel() diff --git a/account_move_reconcile_forbid_cancel/readme/CONTRIBUTORS.md b/account_move_reconcile_forbid_cancel/readme/CONTRIBUTORS.md index dc534b9d..9fed9e74 100644 --- a/account_move_reconcile_forbid_cancel/readme/CONTRIBUTORS.md +++ b/account_move_reconcile_forbid_cancel/readme/CONTRIBUTORS.md @@ -1,3 +1,5 @@ - [Tecnativa](https://www.tecnativa.com): - Ernesto Tejeda - Pedro M. Baeza +- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io) + - Bhavesh Heliconia diff --git a/account_move_reconcile_forbid_cancel/static/description/index.html b/account_move_reconcile_forbid_cancel/static/description/index.html index 8ba347fe..f68b46cc 100644 --- a/account_move_reconcile_forbid_cancel/static/description/index.html +++ b/account_move_reconcile_forbid_cancel/static/description/index.html @@ -420,6 +420,10 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
  • Pedro M. Baeza
  • +
  • Heliconia Solutions Pvt. Ltd.
      +
    • Bhavesh Heliconia
    • +
    +
  • diff --git a/account_move_reconcile_forbid_cancel/tests/test_account_move_reconcile_forbid_cancel.py b/account_move_reconcile_forbid_cancel/tests/test_account_move_reconcile_forbid_cancel.py index 15774421..e86c6150 100644 --- a/account_move_reconcile_forbid_cancel/tests/test_account_move_reconcile_forbid_cancel.py +++ b/account_move_reconcile_forbid_cancel/tests/test_account_move_reconcile_forbid_cancel.py @@ -3,10 +3,12 @@ from odoo import fields from odoo.exceptions import ValidationError -from odoo.tests.common import Form, TransactionCase +from odoo.tests import Form + +from odoo.addons.base.tests.common import BaseCommon -class TestAccountMoveReconcileForbidCancel(TransactionCase): +class TestAccountMoveReconcileForbidCancel(BaseCommon): @classmethod def setUpClass(cls): super().setUpClass()