Skip to content

Commit

Permalink
[16.0][FIX] partner_firstname: fix installation w/ missing names
Browse files Browse the repository at this point in the history
Resolve issue blocking partner_firstname from installation

This change fixes this bug: OCA#1677

With that the module can be installed as only partners with names will be processed
  • Loading branch information
mohs8421 committed Nov 15, 2024
1 parent 9595faa commit cfe74e3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions partner_firstname/tests/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ def tearDown(self):

super(PersonCase, self).tearDown()

def test_module_installation(self):
model = self.env[self.model].with_context(**self.context)
unnamed = model.create(
{"name": "", "email": "anon@ymous.org", "type": "invoice"}
)
named = model.create(
{"name": "firstname lastname", "email": "firstname@lastname.org"}
)
model._install_partner_firstname()
self.assertEqual(unnamed.name, "")
self.assertEqual((named.firstname, named.lastname), ("firstname", "lastname"))

def test_no_name(self):
"""Name is calculated."""
del self.values["name"]
Expand Down

0 comments on commit cfe74e3

Please sign in to comment.