From 6a44b78932b0d1ae338fefbef6b4f8615b99a1cd Mon Sep 17 00:00:00 2001 From: TraiTran Date: Mon, 9 Sep 2024 09:23:08 +0700 Subject: [PATCH] [MIG] pos_cash_move_reason: Migration to 17.0 --- pos_cash_move_reason/README.rst | 1 + pos_cash_move_reason/__manifest__.py | 3 +-- pos_cash_move_reason/readme/CONTRIBUTORS.md | 1 + pos_cash_move_reason/security/res_groups.xml | 11 ----------- .../tests/test_pos_cash_move_reason.py | 10 +++++----- pos_cash_move_reason/views/view_pos_move_reason.xml | 10 ++++------ pos_cash_move_reason/views/view_pos_session.xml | 8 ++------ .../wizard/wizard_pos_move_reason.xml | 9 +++------ 8 files changed, 17 insertions(+), 36 deletions(-) delete mode 100644 pos_cash_move_reason/security/res_groups.xml diff --git a/pos_cash_move_reason/README.rst b/pos_cash_move_reason/README.rst index 30630ca551..7cd6a17e61 100644 --- a/pos_cash_move_reason/README.rst +++ b/pos_cash_move_reason/README.rst @@ -149,6 +149,7 @@ Contributors - Sylvain LE GAL - Dhara Solanki +- Tran Thanh Trai Maintainers ----------- diff --git a/pos_cash_move_reason/__manifest__.py b/pos_cash_move_reason/__manifest__.py index 42396603cc..c4b27737ed 100644 --- a/pos_cash_move_reason/__manifest__.py +++ b/pos_cash_move_reason/__manifest__.py @@ -6,12 +6,11 @@ "author": "ACSONE SA/NV," "GRAP," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/pos", "category": "Point Of sale", - "version": "16.0.1.0.0", + "version": "17.0.1.0.0", "license": "AGPL-3", "depends": ["point_of_sale"], "data": [ "security/ir_rule.xml", - "security/res_groups.xml", "security/ir.model.access.csv", "views/view_pos_move_reason.xml", "views/view_pos_session.xml", diff --git a/pos_cash_move_reason/readme/CONTRIBUTORS.md b/pos_cash_move_reason/readme/CONTRIBUTORS.md index 17c0087b86..f1ac3b5459 100644 --- a/pos_cash_move_reason/readme/CONTRIBUTORS.md +++ b/pos_cash_move_reason/readme/CONTRIBUTORS.md @@ -1,2 +1,3 @@ - Sylvain LE GAL \<\> - Dhara Solanki \<\> +- Tran Thanh Trai \<\> diff --git a/pos_cash_move_reason/security/res_groups.xml b/pos_cash_move_reason/security/res_groups.xml deleted file mode 100644 index a3c394470d..0000000000 --- a/pos_cash_move_reason/security/res_groups.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Use Old PoS 'Put or Take Money' Actions - - diff --git a/pos_cash_move_reason/tests/test_pos_cash_move_reason.py b/pos_cash_move_reason/tests/test_pos_cash_move_reason.py index 3018d7e7bb..9fee028256 100644 --- a/pos_cash_move_reason/tests/test_pos_cash_move_reason.py +++ b/pos_cash_move_reason/tests/test_pos_cash_move_reason.py @@ -14,13 +14,14 @@ def setUpClass(cls): cls.WizardReason = cls.env["wizard.pos.move.reason"] cls.AccountMoveLine = cls.env["account.move.line"] - cls.config = cls.env.ref("point_of_sale.pos_config_main").copy() + cls.config = cls.env.ref("point_of_sale.pos_config_main") cls.cash_journal = cls.env["account.journal"].search( [ ("type", "=", "cash"), ("company_id", "=", cls.env.ref("base.main_company").id), - ] - )[0] + ], + limit=1, + ) cls.deposit_reason = cls.env.ref("pos_cash_move_reason.bank_out_reason") def test_onchange_expense_reason(self): @@ -70,7 +71,6 @@ def test_take_invalid_amount(self): session = self.PosSession.search( [("state", "=", "opening_control"), ("config_id", "=", self.config.id)] ) - # Enter Invalid money with self.assertRaises(UserError): self.WizardReason.with_context( @@ -88,7 +88,7 @@ def test_take_invalid_amount(self): def test_button_put_money(self): self.config._action_to_open_ui() session = self.PosSession.search( - [("state", "=", "opened"), ("config_id", "=", self.config.id)] + [("state", "=", "opening_control"), ("config_id", "=", self.config.id)] ) wiz = session.button_move_income() self.assertEqual(wiz["context"]["default_move_type"], "income") diff --git a/pos_cash_move_reason/views/view_pos_move_reason.xml b/pos_cash_move_reason/views/view_pos_move_reason.xml index 294cb61156..f52d5d2f3f 100644 --- a/pos_cash_move_reason/views/view_pos_move_reason.xml +++ b/pos_cash_move_reason/views/view_pos_move_reason.xml @@ -43,16 +43,14 @@ diff --git a/pos_cash_move_reason/views/view_pos_session.xml b/pos_cash_move_reason/views/view_pos_session.xml index 6fc140f53b..4af711ae46 100644 --- a/pos_cash_move_reason/views/view_pos_session.xml +++ b/pos_cash_move_reason/views/view_pos_session.xml @@ -13,9 +13,7 @@ name="button_move_income" type="object" icon="fa-level-down" - attrs="{'invisible': ['|', - ('display_move_reason_income', '=', False), - ('state', 'not in', ['opened', 'closing_control'])]}" + invisible="not display_move_reason_income or state not in ('opened', 'closing_control')" >
Put @@ -28,9 +26,7 @@ name="button_move_expense" type="object" icon="fa-level-up" - attrs="{'invisible': ['|', - ('display_move_reason_expense', '=', False), - ('state', 'not in', ['opened', 'closing_control'])]}" + invisible="not display_move_reason_expense or state not in ('opened', 'closing_control')" >
Take diff --git a/pos_cash_move_reason/wizard/wizard_pos_move_reason.xml b/pos_cash_move_reason/wizard/wizard_pos_move_reason.xml index 5a8a6b2bcd..67594b3e49 100644 --- a/pos_cash_move_reason/wizard/wizard_pos_move_reason.xml +++ b/pos_cash_move_reason/wizard/wizard_pos_move_reason.xml @@ -6,20 +6,17 @@
- +