From e37d6eb6ab92f12bb17cf1ffeabdb21be776a560 Mon Sep 17 00:00:00 2001 From: DavidJForgeFlow Date: Thu, 16 Jun 2022 11:53:30 +0200 Subject: [PATCH] [FIX]rma: remove test_rma dependency to Account --- rma/tests/test_rma.py | 3 +-- .../tests/test_rma_account_unreconciled.py | 16 +++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/rma/tests/test_rma.py b/rma/tests/test_rma.py index 310c5888..144b3379 100644 --- a/rma/tests/test_rma.py +++ b/rma/tests/test_rma.py @@ -48,7 +48,6 @@ class TestRma(common.SavepointCase): cls.g_rma_customer_user = cls.env.ref("rma.group_rma_customer_user") cls.g_rma_manager = cls.env.ref("rma.group_rma_manager") cls.g_rma_supplier_user = cls.env.ref("rma.group_rma_supplier_user") - cls.g_account_manager = cls.env.ref("account.group_account_manager") cls.g_stock_user = cls.env.ref("stock.group_stock_user") cls.g_stock_manager = cls.env.ref("stock.group_stock_manager") @@ -59,7 +58,7 @@ class TestRma(common.SavepointCase): ) cls.rma_manager_user = cls._create_user( "rma manager", - [cls.g_stock_manager, cls.g_rma_manager, cls.g_account_manager], + [cls.g_stock_manager, cls.g_rma_manager], cls.company, ) # Customer RMA: diff --git a/rma_account_unreconciled/tests/test_rma_account_unreconciled.py b/rma_account_unreconciled/tests/test_rma_account_unreconciled.py index db0e6c5f..27082e0d 100644 --- a/rma_account_unreconciled/tests/test_rma_account_unreconciled.py +++ b/rma_account_unreconciled/tests/test_rma_account_unreconciled.py @@ -10,7 +10,13 @@ class TestRmaAccountUnreconciled(TestRma): def setUpClass(cls): super().setUpClass() cls.rma_refund_wiz = cls.env["rma.refund"] - for categ in cls.rma_customer_id.with_user(cls.rma_manager_user).mapped( + cls.g_account_manager = cls.env.ref("account.group_account_manager") + cls.rma_manager_user_account = cls._create_user( + "rma manager account", + [cls.g_stock_manager, cls.g_rma_manager, cls.g_account_manager], + cls.company, + ) + for categ in cls.rma_customer_id.with_user(cls.rma_manager_user_account).mapped( "rma_line_ids.product_id.categ_id" ): categ.write( @@ -29,9 +35,9 @@ class TestRmaAccountUnreconciled(TestRma): "reconcile": True, } ) - for product in cls.rma_customer_id.with_user(cls.rma_manager_user).mapped( - "rma_line_ids.product_id" - ): + for product in cls.rma_customer_id.with_user( + cls.rma_manager_user_account + ).mapped("rma_line_ids.product_id"): product.write( { "standard_price": 10.0, @@ -85,7 +91,7 @@ class TestRmaAccountUnreconciled(TestRma): ) make_refund.invoice_refund() self.rma_customer_id.with_user( - self.rma_manager_user + self.rma_manager_user_account ).rma_line_ids.refund_line_ids.move_id.filtered( lambda x: x.state != "posted" ).action_post()