[14.0][MIG] agreement_serviceprofile (Version 12.0 to 14.0)

[MIG] Black

[MIG] Black
This commit is contained in:
Patrick Wilson
2021-05-04 13:49:14 -06:00
committed by Olga Marco
parent 7a4e3df740
commit 2e19f4a2ba
14 changed files with 290 additions and 147 deletions

View File

@@ -0,0 +1,26 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
from odoo.tests.common import TransactionCase
class TestProduct(TransactionCase):
def setUp(self):
super().setUp()
self.test_product1 = self.env["product.template"].create(
{"name": "TestProduct"}
)
self.test_product2 = self.env["product.product"].create({"name": "TestProduct"})
# TEST 01: Test onchange_type product.template
def test_product_template_onchange_type(self):
product_01 = self.test_product1
product_01.is_serviceprofile = True
product_01.onchange_type()
self.assertEqual(product_01.type, "service")
# TEST 02: Test onchange_type product.product
def test_product_product_onchange_type(self):
product_02 = self.test_product2
product_02.is_serviceprofile = True
product_02.onchange_type()
self.assertEqual(product_02.type, "service")