diff --git a/account_move_tier_validation_approver/README.rst b/account_move_tier_validation_approver/README.rst index b640ea408001..47a689ffdac0 100644 --- a/account_move_tier_validation_approver/README.rst +++ b/account_move_tier_validation_approver/README.rst @@ -90,6 +90,9 @@ Contributors - Lois Rilo - Adrià Gil Sorribes +- [360ERP](https://www.360erp.com): + + - Kevin Khao <> Maintainers ----------- diff --git a/account_move_tier_validation_approver/__manifest__.py b/account_move_tier_validation_approver/__manifest__.py index 1379f9367e05..e89ba3b773f2 100644 --- a/account_move_tier_validation_approver/__manifest__.py +++ b/account_move_tier_validation_approver/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Account Move Tier Validation Approver", - "version": "15.0.1.0.0", + "version": "18.0.1.0.0", "author": "ForgeFlow, Odoo Community Association (OCA)", "category": "Accounting", "license": "AGPL-3", diff --git a/account_move_tier_validation_approver/models/account_move.py b/account_move_tier_validation_approver/models/account_move.py index 5c09bd2ee10a..39f5fa9c8652 100644 --- a/account_move_tier_validation_approver/models/account_move.py +++ b/account_move_tier_validation_approver/models/account_move.py @@ -1,7 +1,7 @@ # Copyright 2021 ForgeFlow, S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models +from odoo import api, fields, models from odoo.exceptions import UserError @@ -26,7 +26,7 @@ def _post(self, soft=True): and not move.approver_id ): raise UserError( - _( + self.env._( "It is mandatory to indicate a Responsible for Approval (in {})" ).format(move.name) ) diff --git a/account_move_tier_validation_approver/readme/CONTRIBUTORS.md b/account_move_tier_validation_approver/readme/CONTRIBUTORS.md index 690846b7a8a5..9d2ecd5477bd 100644 --- a/account_move_tier_validation_approver/readme/CONTRIBUTORS.md +++ b/account_move_tier_validation_approver/readme/CONTRIBUTORS.md @@ -1,2 +1,4 @@ - Lois Rilo \<\> - Adrià Gil Sorribes \<\> +- \[360ERP\](): + - Kevin Khao \<\<\>\> diff --git a/account_move_tier_validation_approver/static/description/index.html b/account_move_tier_validation_approver/static/description/index.html index b3527432a936..2748f5de5bf3 100644 --- a/account_move_tier_validation_approver/static/description/index.html +++ b/account_move_tier_validation_approver/static/description/index.html @@ -433,6 +433,10 @@

Contributors

diff --git a/account_move_tier_validation_approver/tests/test_account_move_tier_validation_approver.py b/account_move_tier_validation_approver/tests/test_account_move_tier_validation_approver.py index c1b3efae08c7..1c5220a956ad 100644 --- a/account_move_tier_validation_approver/tests/test_account_move_tier_validation_approver.py +++ b/account_move_tier_validation_approver/tests/test_account_move_tier_validation_approver.py @@ -4,17 +4,20 @@ from odoo.exceptions import ValidationError from odoo.tests.common import TransactionCase +from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT + class TestAccountMoveTierValidationApprover(TransactionCase): def setUp(self): - super(TestAccountMoveTierValidationApprover, self).setUp() + super().setUp() + self.env = self.env(context=dict(self.env.context, **DISABLED_MAIL_CONTEXT)) self.res_partner_1 = self.env["res.partner"].create( {"name": "Wood Corner", "email": "example@yourcompany.com"} ) self.product_1 = self.env["product.product"].create( {"name": "Desk Combination"} ) - self.currency_euro = self.env["res.currency"].search([("name", "=", "EUR")]) + self.currency_usd = self.env["res.currency"].search([("name", "=", "USD")]) self.test_user_1 = self.env["res.users"].create( {"name": "User", "login": "test1", "email": "example@yourcompany.com"} ) @@ -26,7 +29,7 @@ def setUp(self): { "move_type": "in_invoice", "partner_id": self.res_partner_1.id, - "currency_id": self.currency_euro.id, + "currency_id": self.currency_usd.id, "approver_id": self.test_approver.id, "invoice_line_ids": [ ( @@ -69,7 +72,6 @@ def test_field_validation_approver(self): {"approver_id": self.test_approver.id, "invoice_date": record.date} ) record.with_user(self.test_user_1.id).request_validation() - record.invalidate_cache() record.with_user(self.test_user_1.id).validate_tier() with self.assertRaises(ValidationError): record.action_post() diff --git a/account_move_tier_validation_approver/views/account_move_views.xml b/account_move_tier_validation_approver/views/account_move_views.xml index bc119a6ed821..5f6d2c52b740 100644 --- a/account_move_tier_validation_approver/views/account_move_views.xml +++ b/account_move_tier_validation_approver/views/account_move_views.xml @@ -10,7 +10,8 @@ diff --git a/account_move_tier_validation_approver/views/res_config_settings_views.xml b/account_move_tier_validation_approver/views/res_config_settings_views.xml index 3dff01b7b6e2..1ffdb4d527eb 100644 --- a/account_move_tier_validation_approver/views/res_config_settings_views.xml +++ b/account_move_tier_validation_approver/views/res_config_settings_views.xml @@ -5,26 +5,14 @@ res.config.settings - -
+ -
- -
-
-
-
+ +
diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 000000000000..9eee3eb208d1 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,2 @@ +odoo-addon-base_tier_validation @ git+https://github.com/OCA/server-ux.git@refs/pull/966/head#subdirectory=base_tier_validation +odoo-addon-account_move_tier_validation @ git+https://github.com/OCA/account-invoicing.git@refs/pull/1830/head#subdirectory=account_move_tier_validation