[IMP] product_contract: code improvements

This commit is contained in:
Ilyas
2023-03-22 09:28:04 +01:00
parent 72c7743293
commit f3cb7beb71
5 changed files with 106 additions and 72 deletions

View File

@@ -3,15 +3,23 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.exceptions import ValidationError
from odoo.tests.common import TransactionCase
from odoo.tests.common import SavepointCase
class TestProductTemplate(TransactionCase):
def setUp(self):
super(TestProductTemplate, self).setUp()
self.service_product = self.env.ref("product.product_product_1")
self.consu_product = self.env.ref("product.product_product_5")
self.contract = self.env["contract.template"].create({"name": "Test"})
class TestProductTemplate(SavepointCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(
context=dict(
cls.env.context,
tracking_disable=True,
no_reset_password=True,
)
)
cls.service_product = cls.env.ref("product.product_product_1")
cls.consu_product = cls.env.ref("product.product_product_5")
cls.contract = cls.env["contract.template"].create({"name": "Test"})
def test_change_is_contract(self):
"""It should verify that the property_contract_template_id