[FIX,IMP]: hr: Fixes and improvements for employee-user relation

bzr revid: rpa@tinyerp.com-20120808101305-dsqn337ngmcysm4z
This commit is contained in:
Rucha (Open ERP)
2012-08-08 15:43:05 +05:30
parent 28192998bd
commit 2347f44ab2
3 changed files with 51 additions and 35 deletions
+36 -21
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -4,9 +4,9 @@
!record {model: project.task.work, id: project_task_work1}:
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
name: Test Timesheet records
task_id: project.project_task_1
task_id: project.project_task_10
hours: 20.0
user_id: base.user_niv
user_id: base.user_fpi
company_id: base.main_company
-
I check Timesheet line for employee in current Timesheet
@@ -14,8 +14,8 @@
!python {model: hr.analytic.timesheet}: |
import datetime
start = (datetime.date.today().strftime('%Y-%m-%d'))
task_work = self.search(cr, uid, [("name","=","Prepare Requirements Document: Test Timesheet records")],context)[0]
task_work = self.search(cr, uid, [("name","=","Social network integration: Test Timesheet records")],context)[0]
task_ids = self.browse(cr, uid, task_work, context)
assert task_ids.user_id.id == ref("base.user_niv"), 'Error, The User in Timesheet is not Correct'
assert task_ids.user_id.id == ref("base.user_fpi"), 'Error, The User in Timesheet is not Correct'
assert task_ids.date == start, 'Error, The Date in Timesheet is not ok'
assert task_ids.product_uom_id.name == "Hour", 'Error, The Hour in Timesheet is not ok'