Skip to content

Commit

Permalink
[MIG] partner_company_type: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
absal-smile committed Jan 30, 2025
1 parent f6ddbf8 commit e56d0eb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
25 changes: 24 additions & 1 deletion partner_company_type/tests/test_res_partner_company_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,29 @@ def setUpClass(cls):

def test_00_duplicate(self):
# Test Duplicate Company type

with self.assertRaises(IntegrityError), tools.mute_logger("odoo.sql_db"):
self.company_type.create(dict(name=self.company_type.name))

def test_create_company_type(self):
# Test creating a new company type
new_company_type = self.company_type.create(dict(name="New Company Type"))
self.assertTrue(new_company_type, "New company type should be created")

def test_update_company_type(self):
# Test updating an existing company type
self.company_type.write(dict(name="Updated Company Type"))
self.assertEqual(
self.company_type.name,
"Updated Company Type",
"Company type name should be updated",
)

def test_delete_company_type(self):
# Test deleting a company type
company_type_to_delete = self.company_type.create(
dict(name="Company Type to Delete")
)
company_type_to_delete.unlink()
self.assertFalse(
company_type_to_delete.exists(), "Company type should be deleted"
)
10 changes: 5 additions & 5 deletions partner_company_type/views/res_partner_company_type.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@
</search>
</field>
</record>
<record model="ir.ui.view" id="res_partner_company_type_tree_view">
<record model="ir.ui.view" id="res_partner_company_type_list_view">
<field name="name">
res.partner.company.type.tree (in partner_company_type)
res.partner.company.type.list (in partner_company_type)
</field>
<field name="model">res.partner.company.type</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="name" />
<field name="shortcut" />
</tree>
</list>
</field>
</record>
<record model="ir.actions.act_window" id="res_partner_company_type_act_window">
<field name="name">Company Types</field>
<field name="res_model">res.partner.company.type</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field name="domain">[]</field>
<field name="context">{}</field>
</record>
Expand Down

0 comments on commit e56d0eb

Please sign in to comment.