@@ -11,6 +11,7 @@ def setUp(self):
1111 self .ResUsers = self .env ["res.users" ]
1212 self .Company = self .env ["res.company" ]
1313 self .Project = self .env ["project.project" ]
14+ self .HrDepartment = self .env ["hr.department" ]
1415 self .HrEmployee = self .env ["hr.employee" ]
1516 self .HrTimesheetSheet = self .env ["hr_timesheet.sheet" ]
1617 self .AccountAnalyticLine = self .env ["account.analytic.line" ]
@@ -43,7 +44,10 @@ def test_autocreate(self):
4344 "company_id" : self .company_id .id ,
4445 }
4546 )
46- employee = self .HrEmployee .create ({"name" : "Employee" , "user_id" : user .id })
47+ department = self .HrDepartment .create ({"name" : "Department 1" })
48+ employee = self .HrEmployee .create (
49+ {"name" : "Employee" , "user_id" : user .id , "department_id" : department .id }
50+ )
4751 project = self .Project .create ({"name" : "Project" })
4852
4953 aal_1 = self .AccountAnalyticLine .create (
@@ -67,6 +71,7 @@ def test_autocreate(self):
6771 self .assertTrue (aal_1 .sheet_id )
6872 self .assertTrue (aal_2 .sheet_id )
6973 self .assertEqual (aal_1 .sheet_id , aal_2 .sheet_id )
74+ self .assertEqual (aal_1 .sheet_id .department_id , employee .department_id )
7075
7176 def test_already_confirmed (self ):
7277 user = self .ResUsers .sudo ().create (
0 commit comments