-
-
Notifications
You must be signed in to change notification settings - Fork 871
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][FIX] partner_firstname: fix installation w/ missing names
Resolve issue blocking partner_firstname from installation This change fixes this bug: #1677 With that the module can be installed as only partners with names will be processed
- Loading branch information
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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": "[email protected]", "type": "invoice"} | ||
) | ||
named = model.create( | ||
{"name": "firstname lastname", "email": "[email protected]"} | ||
) | ||
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"] | ||
|