From 8d24e5db5085bd3cbddf3f771bb24d568756d762 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Thu, 22 Apr 2010 11:43:09 +0530 Subject: [PATCH] [IMP]:hr_timesheet_invoice:Improved SQL view report.(Timesheet Line) bzr revid: apa@tinyerp.com-20100422061309-hjcrf1opyj2b636v --- .../report/hr_timesheet_invoice_report.py | 8 +-- .../hr_timesheet_invoice_report_view.xml | 50 ++++++++++++++----- 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py index 525f2783123..b7cf2e8a2df 100644 --- a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py +++ b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py @@ -29,7 +29,8 @@ class report_timesheet_line(osv.osv): _columns = { 'name': fields.char('Year',size=64,required=False, readonly=True), 'user_id':fields.many2one('res.users', 'User', readonly=True), - 'day' : fields.date('Day', readonly=True), + 'date' : fields.date('Date', readonly=True), + 'day': fields.char('Day', size=128, readonly=True), 'quantity': fields.float('Quantity', readonly=True), 'cost': fields.float('Cost', readonly=True), 'product_id' : fields.many2one('product.product', 'Product',readonly=True), @@ -46,10 +47,11 @@ class report_timesheet_line(osv.osv): create or replace view report_timesheet_line as ( select min(l.id) as id, + l.date as date, to_char(l.date,'YYYY') as name, to_char(l.date,'MM') as month, l.user_id, - l.date as day, + to_char(l.date, 'YYYY-MM-DD') as day, l.invoice_id, l.product_id, l.account_id, @@ -62,8 +64,6 @@ class report_timesheet_line(osv.osv): l.user_id is not null group by l.date, - to_char(l.date,'YYYY'), - to_char(l.date,'MM'), l.user_id, l.product_id, l.account_id, 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 614ec0e0550..4de60162d1a 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 @@ -26,10 +26,11 @@ tree - - - - + + + + + @@ -46,19 +47,42 @@ - - - - - - + + + + + + + + + + + + + + + + @@ -76,7 +100,7 @@ report.timesheet.line form tree,graph - {'search_default_User': 1} + {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}