From 2fddb283e50eaf9febd7147d549b196dbb24b9a3 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 28 Apr 2010 11:57:43 +0530 Subject: [PATCH] [IMP]:hr_timesheet_sheet:Improved SQL report.(Timesheet). bzr revid: apa@tinyerp.com-20100428062743-cwkcunmyn2gjojdi --- .../report/hr_timesheet_invoice_report_view.xml | 2 +- addons/hr_timesheet_sheet/report/timesheet_report.py | 11 ++++------- .../report/timesheet_report_view.xml | 12 +++++------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml index 4de60162d1a..d61203df1ef 100644 --- a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml +++ b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml @@ -103,7 +103,7 @@ {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]} - + diff --git a/addons/hr_timesheet_sheet/report/timesheet_report.py b/addons/hr_timesheet_sheet/report/timesheet_report.py index ee016df56d7..7b79470a9b7 100644 --- a/addons/hr_timesheet_sheet/report/timesheet_report.py +++ b/addons/hr_timesheet_sheet/report/timesheet_report.py @@ -45,9 +45,8 @@ class timesheet_report(osv.osv): ('draft','Draft'), ('confirm','Confirmed'), ('done','Done')], 'State', readonly=True), - 'total_att': fields.float('Total Timesheet',readonly=True), - 'total_ts': fields.float('Total Attendance',readonly=True), - 'total_diff': fields.float('Difference', readonly=True), + 'quantity': fields.float('#Quantity',readonly=True), + 'cost': fields.float('#Cost',readonly=True), } def init(self, cr): @@ -64,9 +63,8 @@ class timesheet_report(osv.osv): to_char(htss.date_current,'MM') as month, to_char(htss.date_current, 'YYYY-MM-DD') as day, count(*) as nbr, - sum(day.total_attendance) as total_att, - sum(day.total_timesheet) as total_ts, - sum(day.total_difference) as total_diff, + sum(aal.unit_amount) as quantity, + sum(aal.amount) as cost, aal.account_id, htss.user_id, htss.company_id, @@ -75,7 +73,6 @@ class timesheet_report(osv.osv): from account_analytic_line as aal left join hr_analytic_timesheet as hat ON (hat.line_id=aal.id) left join hr_timesheet_sheet_sheet as htss ON (hat.line_id=htss.id) - left join hr_timesheet_sheet_sheet_day AS day ON (htss.id = day.sheet_id) group by to_char(htss.date_current,'YYYY'), to_char(htss.date_current,'MM'), diff --git a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml index 976b2a6f8ea..2520d5054fb 100644 --- a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml +++ b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml @@ -7,10 +7,9 @@ graph - - - - + + + @@ -25,9 +24,8 @@ - - - + +