diff --git a/edi_sale_oca/tests/common.py b/edi_sale_oca/tests/common.py index 2fc1f15406b..523642abb62 100644 --- a/edi_sale_oca/tests/common.py +++ b/edi_sale_oca/tests/common.py @@ -46,5 +46,6 @@ def _setup_order(cls, **kw): if line_defaults: for line in vals["order_line"]: line.update(line_defaults) - cls.sale = cls._create_sale_order(**vals) - cls.sale.action_confirm() + sale = cls._create_sale_order(**vals) + sale.action_confirm() + return sale diff --git a/edi_sale_oca/tests/test_order.py b/edi_sale_oca/tests/test_order.py index 8a182380758..da5591c512a 100644 --- a/edi_sale_oca/tests/test_order.py +++ b/edi_sale_oca/tests/test_order.py @@ -20,7 +20,7 @@ def setUpClass(cls): cls.exc_record_in = cls.backend.create_record( cls.exchange_type_in.code, {"edi_exchange_state": "input_received"} ) - cls._setup_order( + cls.order = cls._setup_order( origin_exchange_record_id=cls.exc_record_in.id, ) @@ -29,7 +29,7 @@ def _get_backend(cls): return cls.env.ref("edi_sale_oca.demo_edi_backend") def test_line_origin(self): - order = self.sale + order = self.order self.assertEqual(order.origin_exchange_record_id, self.exc_record_in) lines = order.order_line self.env["sale.order.line"].create(