-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] fiscal_company_base: Migration to 16.0 (from 12.0)
- Loading branch information
1 parent
f4c7c4d
commit 6cf2208
Showing
4 changed files
with
9 additions
and
14 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
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
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
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 |
---|---|---|
|
@@ -34,7 +34,7 @@ def setUp(self): | |
def test_01_res_users_propagate_access_right_create(self): | ||
"""[Functional Test] A new user with access to mother company must | ||
have access to child companies""" | ||
new_user = self.ResUsers.sudo(user=self.user_accountant).create( | ||
new_user = self.ResUsers.with_user(user=self.user_accountant).create( | ||
{ | ||
"name": "new_user", | ||
"login": "[email protected]", | ||
|
@@ -71,7 +71,7 @@ def test_03_res_company_check_contraint_fail_01(self): | |
"""[Contraint Test] Try to create a company with | ||
'fiscal_type != 'child' and and a mother company.""" | ||
with self.assertRaises(ValidationError): | ||
self.ResCompany.sudo(user=self.user_accountant).create( | ||
self.ResCompany.with_user(user=self.user_accountant).create( | ||
{ | ||
"name": "new_company", | ||
"fiscal_type": "normal", | ||
|
@@ -83,15 +83,15 @@ def test_04_res_company_check_contraint_fail_02(self): | |
"""[Contraint Test] Try to create a company with | ||
'fiscal_type != 'child' and and a mother company.""" | ||
with self.assertRaises(ValidationError): | ||
self.ResCompany.sudo(user=self.user_accountant).create( | ||
self.ResCompany.with_user(user=self.user_accountant).create( | ||
{ | ||
"name": "new_company_1", | ||
"fiscal_type": "fiscal_mother", | ||
"fiscal_company_id": self.mother_company.id, | ||
} | ||
) | ||
with self.assertRaises(ValidationError): | ||
self.ResCompany.sudo(user=self.user_accountant).create( | ||
self.ResCompany.with_user(user=self.user_accountant).create( | ||
{ | ||
"name": "new_company_2", | ||
"fiscal_type": "normal", | ||
|
@@ -103,7 +103,7 @@ def test_05_res_company_check_contraint_fail_03(self): | |
"""[Contraint Test] Try to create a company with | ||
'fiscal_type = 'child' without a mother company.""" | ||
with self.assertRaises(ValidationError): | ||
self.ResCompany.sudo(user=self.user_accountant).create( | ||
self.ResCompany.with_user(user=self.user_accountant).create( | ||
{ | ||
"name": "new_company", | ||
"fiscal_type": "fiscal_child", | ||
|
@@ -113,7 +113,7 @@ def test_05_res_company_check_contraint_fail_03(self): | |
|
||
def test_06_res_company_create_child_propagate_success(self): | ||
"""[Contraint Test] Create a child company and check propagation.""" | ||
new_company = self.ResCompany.sudo(user=self.user_accountant).create( | ||
new_company = self.ResCompany.with_user(user=self.user_accountant).create( | ||
{ | ||
"name": "new_company", | ||
"fiscal_type": "fiscal_child", | ||
|
@@ -132,10 +132,10 @@ def test_06_res_company_create_child_propagate_success(self): | |
def test_07_res_company_write_child_propagate_success(self): | ||
"""[Contraint Test] Create and write a child company and check | ||
propagation.""" | ||
new_company = self.ResCompany.sudo(user=self.user_accountant).create( | ||
new_company = self.ResCompany.with_user(user=self.user_accountant).create( | ||
{"name": "new_company", "fiscal_type": "normal"} | ||
) | ||
new_company.sudo(user=self.user_accountant).write( | ||
new_company.with_user(user=self.user_accountant).write( | ||
{"fiscal_type": "fiscal_child", "fiscal_company_id": self.mother_company.id} | ||
) | ||
|
||
|