diff --git a/account_move_tier_validation/models/account_move.py b/account_move_tier_validation/models/account_move.py index aed37b56a0f5..ea08491ef40c 100644 --- a/account_move_tier_validation/models/account_move.py +++ b/account_move_tier_validation/models/account_move.py @@ -1,7 +1,7 @@ # Copyright <2020> PESOL # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) -from odoo import _, api, models +from odoo import api, models class AccountMove(models.Model): @@ -25,13 +25,13 @@ def _get_under_validation_exceptions(self): def _get_to_validate_message_name(self): name = super()._get_to_validate_message_name() if self.move_type == "in_invoice": - name = _("Bill") + name = self.env._("Bill") elif self.move_type == "in_refund": - name = _("Refund") + name = self.env._("Refund") elif self.move_type == "out_invoice": - name = _("Invoice") + name = self.env._("Invoice") elif self.move_type == "out_refund": - name = _("Credit Note") + name = self.env._("Credit Note") return name def action_post(self): diff --git a/account_move_tier_validation/tests/test_tier_validation.py b/account_move_tier_validation/tests/test_tier_validation.py index a17ddd78dea5..49ab351dc99e 100644 --- a/account_move_tier_validation/tests/test_tier_validation.py +++ b/account_move_tier_validation/tests/test_tier_validation.py @@ -1,7 +1,7 @@ # Copyright 2018 ForgeFlow S.L. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). -from odoo import _, fields +from odoo import fields from odoo.exceptions import ValidationError from odoo.tests import Form from odoo.tests.common import TransactionCase, tagged @@ -76,7 +76,7 @@ def test_03_move_post(self): invoice.invalidate_model() invoice.validate_tier() with self.assertRaisesRegex( - ValidationError, _("You are not allowed to write those fields") + ValidationError, self.env._("You are not allowed to write those fields") ): invoice._post() # Calls _post method by passing context skip_validation_check set to True