Skip to content

Commit

Permalink
Merge PR #1437 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Oct 23, 2023
2 parents 4e2a9e1 + ca1ee86 commit 16f964e
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 6 deletions.
10 changes: 10 additions & 0 deletions product_category_active/tests/test_product_category_active.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ class TestProductCategoryActive(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
# Remove this variable in v16 and put instead:
# from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
DISABLED_MAIL_CONTEXT = {
"tracking_disable": True,
"mail_create_nolog": True,
"mail_create_nosubscribe": True,
"mail_notrack": True,
"no_reset_password": True,
}
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
categ_obj = cls.env["product.category"]
product_obj = cls.env["product.template"]
cls.parent_categ = categ_obj.create({"name": "Parent category"})
Expand Down
10 changes: 10 additions & 0 deletions product_code_unique/tests/test_code_unique.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ class TestCodeUnique(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
# Remove this variable in v16 and put instead:
# from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
DISABLED_MAIL_CONTEXT = {
"tracking_disable": True,
"mail_create_nolog": True,
"mail_create_nosubscribe": True,
"mail_notrack": True,
"no_reset_password": True,
}
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
cls.product_obj = cls.env["product.product"]
cls.product1 = cls.product_obj.create(
{"name": "Test Product 1", "default_code": "TSTP1"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ class TestProductPricelistDirectPrint(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestProductPricelistDirectPrint, cls).setUpClass()

# Remove this variable in v16 and put instead:
# from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
DISABLED_MAIL_CONTEXT = {
"tracking_disable": True,
"mail_create_nolog": True,
"mail_create_nosubscribe": True,
"mail_notrack": True,
"no_reset_password": True,
}
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
# Set report layout to void to wizard selection layout crashes the test
report_layout = cls.env.ref("web.report_layout_standard")
main_company = cls.env.ref("base.main_company")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ class TestProductPricelistRevision(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
# Remove this variable in v16 and put instead:
# from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
DISABLED_MAIL_CONTEXT = {
"tracking_disable": True,
"mail_create_nolog": True,
"mail_create_nosubscribe": True,
"mail_notrack": True,
"no_reset_password": True,
}
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
cls.pricelist_obj = cls.env["product.pricelist"]
cls.pricelist_item_obj = cls.env["product.pricelist.item"]
cls.product_category_obj = cls.env["product.category"]
Expand Down
10 changes: 10 additions & 0 deletions product_secondary_unit/tests/test_product_second_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ class TestProductSecondaryUnit(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
# Remove this variable in v16 and put instead:
# from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
DISABLED_MAIL_CONTEXT = {
"tracking_disable": True,
"mail_create_nolog": True,
"mail_create_nosubscribe": True,
"mail_notrack": True,
"no_reset_password": True,
}
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
cls.product_uom_kg = cls.env.ref("uom.product_uom_kgm")
cls.product_uom_unit = cls.env.ref("uom.product_uom_unit")
cls.product = cls.env["product.template"].create(
Expand Down
10 changes: 10 additions & 0 deletions product_secondary_unit/tests/test_secondary_unit_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ class TestProductSecondaryUnitMixin(TransactionCase, FakeModelLoader):
@classmethod
def setUpClass(cls):
super().setUpClass()
# Remove this variable in v16 and put instead:
# from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
DISABLED_MAIL_CONTEXT = {
"tracking_disable": True,
"mail_create_nolog": True,
"mail_create_nosubscribe": True,
"mail_notrack": True,
"no_reset_password": True,
}
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
cls.loader = FakeModelLoader(cls.env, cls.__module__)
cls.loader.backup_registry()
from .models import SecondaryUnitFake
Expand Down
21 changes: 16 additions & 5 deletions product_sequence/tests/test_product_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,22 @@
class TestProductSequence(TransactionCase):
"""Tests for creating product with and without Product Sequence"""

def setUp(self):
super(TestProductSequence, self).setUp()
self.product_product = self.env["product.product"]
self.product_category = self.env["product.category"]
self.product_template = self.env["product.template"].create(
@classmethod
def setUpClass(cls):
super(TestProductSequence, cls).setUpClass()
# Remove this variable in v16 and put instead:
# from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
DISABLED_MAIL_CONTEXT = {
"tracking_disable": True,
"mail_create_nolog": True,
"mail_create_nosubscribe": True,
"mail_notrack": True,
"no_reset_password": True,
}
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
cls.product_product = cls.env["product.product"]
cls.product_category = cls.env["product.category"]
cls.product_template = cls.env["product.template"].create(
{"name": "Demo Product"}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ class TestProductSupplierinfoForCustomer(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
# Remove this variable in v16 and put instead:
# from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
DISABLED_MAIL_CONTEXT = {
"tracking_disable": True,
"mail_create_nolog": True,
"mail_create_nosubscribe": True,
"mail_notrack": True,
"no_reset_password": True,
}
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
cls.supplierinfo_model = cls.env["product.supplierinfo"]
cls.customerinfo_model = cls.env["product.customerinfo"]
cls.pricelist_item_model = cls.env["product.pricelist.item"]
Expand Down

0 comments on commit 16f964e

Please sign in to comment.