From 8b960a48041c0130c43a77a6774ca89ad0ba3975 Mon Sep 17 00:00:00 2001 From: gaelTorrecillas Date: Wed, 15 Jan 2025 12:19:55 +0100 Subject: [PATCH] [MIG] 18.0 packaging_uom --- packaging_uom/tests/test_product_packaging.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packaging_uom/tests/test_product_packaging.py b/packaging_uom/tests/test_product_packaging.py index 43a12dfc537..63e725a3aa8 100644 --- a/packaging_uom/tests/test_product_packaging.py +++ b/packaging_uom/tests/test_product_packaging.py @@ -4,12 +4,13 @@ from odoo.addons.base.tests.common import SavepointCaseWithUserDemo -class TestProductPackaging(SavepointCaseWithUserDemo): +class TestProductPackaging(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) cls.packaging_obj = cls.env["product.packaging"] + cls.uom_obj = cls.env["uom.uom"] cls.uom_unit = cls.env.ref("uom.product_uom_unit") cls.uom_dozen = cls.env.ref("uom.product_uom_dozen") cls.product_dozen = cls.env["product.product"].create( @@ -65,7 +66,7 @@ def test_compute_quantity_by_package(self): product_packaging_unit.uom_categ_domain_id, "The UOM domain is not well set", ) - product_uom_24 = self.env["uom.uom"].create( + product_uom_24 = self.uom_obj.create( { "category_id": self.env.ref("uom.product_uom_categ_unit").id, "name": "Double Dozens", @@ -77,7 +78,7 @@ def test_compute_quantity_by_package(self): self.assertAlmostEqual(product_packaging_dozen.qty, 0.5) product_packaging_unit.uom_id = product_uom_24 self.assertAlmostEqual(product_packaging_unit.qty, 24) - product_uom_6 = self.env["uom.uom"].create( + product_uom_6 = self.uom_obj.create( { "category_id": self.env.ref("uom.product_uom_categ_unit").id, "name": "Demi Dozens", @@ -97,7 +98,7 @@ def test_compute_quantity_by_package(self): product_packaging_dozen.uom_id = None # Define a new packaging unit - uom_524 = self.env["uom.uom"].search( + uom_524 = self.uom_obj.search( [ ( "category_id",