Skip to content

Commit

Permalink
[FIX] hr_timesheet_begin_end: Test uses timesheet lines now
Browse files Browse the repository at this point in the history
Timesheet lines are characterised by having a project.

Signed-off-by: Carmen Bianca BAKKER <[email protected]>
  • Loading branch information
carmenbianca committed Jun 28, 2024
1 parent b4124b5 commit c5931f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed the test to use timesheet lines instead of bare analytic lines.
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ class TestBeginEnd(common.TransactionCase):
def setUp(self):
super(TestBeginEnd, self).setUp()
self.timesheet_line_model = self.env['account.analytic.line']
self.analytic = self.env.ref('analytic.analytic_administratif')
self.user = self.env.ref('base.user_root')
self.project = self.env.ref('project.project_project_1')
self.employee = self.env.ref('hr.employee_qdp')
self.base_line = {
'name': 'test',
'date': fields.Date.today(),
'time_start': 10.,
'time_stop': 12.,
'user_id': self.user.id,
'unit_amount': 2.,
'account_id': self.analytic.id,
'amount': -60.,
'project_id': self.project.id,
'employee_id': self.employee.id,
}

def test_onchange(self):
line = self.timesheet_line_model.new({
'name': 'test',
'time_start': 10.,
'time_stop': 12.,
'project_id': self.project.id,
})
line.onchange_hours_start_stop()
self.assertEquals(line.unit_amount, 2)
Expand Down

0 comments on commit c5931f9

Please sign in to comment.