summaryrefslogtreecommitdiff
path: root/addons/report_task/report_task.py
diff options
context:
space:
mode:
authorJay (Open ERP) <jvo@tinyerp.com>2009-03-12 20:24:20 +0530
committerJay (Open ERP) <jvo@tinyerp.com>2009-03-12 20:24:20 +0530
commit3cb79589aee3d2bb0d0cb0d53a6b59891a6f1095 (patch)
treef09689741e69bd68cbb0fb0fabe08f63a45f6685 /addons/report_task/report_task.py
parent07f30e8310f3048cfa0c454786996da2fd8c2f00 (diff)
Added turnover Per month report for board_service
bzr revid: jvo@tinyerp.com-20090312145420-l6k2qst6miqh9c8q
Diffstat (limited to 'addons/report_task/report_task.py')
-rw-r--r--addons/report_task/report_task.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/addons/report_task/report_task.py b/addons/report_task/report_task.py
index 92272468c9b..758a654a7a4 100644
--- a/addons/report_task/report_task.py
+++ b/addons/report_task/report_task.py
@@ -59,6 +59,44 @@ class report_task_user_pipeline_open (osv.osv):
report_task_user_pipeline_open()
+#class report_timesheet_task(osv.osv):
+# _name = "report.timesheet.task"
+# _description = "Report on Timesheets and Tasks per User Per Month"
+# _auto = False
+#
+# def get_hrs_timesheet(self, cr, uid, ids, name,args,context):
+# result = {}
+#
+# for record in self.browse(cr, uid, ids, context):
+# last_date = mx.DateTime.strptime(record.month, '%Y-%m-%d') + mx.DateTime.RelativeDateTime(months=1) - 1
+# obj=self.pool.get('hr_timesheet_sheet.sheet')
+# sheet_ids = obj.search(cr,uid,[('user_id','=',record.user_id.id),('date_current','>=',record.month),('date_current','<=',last_date.strftime('%Y-%m-%d'))])
+# data_days = obj.read(cr,uid,sheet_ids,['total_attendance_day','date_current','user_id'])
+# total = 0.0
+# for day_attendance in data_days:
+# total += day_attendance['total_attendance_day']
+# result[record.id] = total
+#
+# return result
+#
+# _columns = {
+# 'month': fields.date('Month', required=True,readonly=True),
+# 'user_id': fields.many2one('res.users', 'User' ,readonly=True, required=True),
+# 'timesheet_hrs': fields.function(get_hrs_timesheet,method=True, string="Timesheet Hrs" ),
+# 'task_hrs': fields.float('Task Hrs', readonly=True, required=True),
+# }
+#
+#
+# def init(self, cr):
+# cr.execute("""create or replace view report_timesheet_task as (
+# select min(p.id) as id, to_char(p.date, 'YYYY-MM-01') as month, min(r.id) as user_id, sum(p.hours) as task_hrs,0.0 as timesheet_hrs
+# from project_task_work p,res_users r
+# where (r.id=p.user_id)
+# group by to_char(p.date, 'YYYY-MM-01'))""")
+#
+#
+#
+#report_timesheet_task()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: