[MOD/IMP]hr_timesheet_sheet : Usability Improvement in Reports
authorAMP (OpenERP) <amp@tinyerp.com>
Thu, 23 Sep 2010 11:45:06 +0000 (17:15 +0530)
committerAMP (OpenERP) <amp@tinyerp.com>
Thu, 23 Sep 2010 11:45:06 +0000 (17:15 +0530)
bzr revid: amp@tinyerp.com-20100923114506-zak8715z2gkncg48

addons/hr_timesheet_sheet/report/hr_timesheet_report.py
addons/hr_timesheet_sheet/report/hr_timesheet_report_view.xml
addons/hr_timesheet_sheet/report/timesheet_report_view.xml

index 100041c..84ef868 100644 (file)
@@ -28,6 +28,7 @@ class hr_timesheet_report(osv.osv):
     _auto = False
     _columns = {
         'year': fields.char('Year',size=64,required=False, readonly=True),
+        'day': fields.char('Day', size=128, readonly=True),
         'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
             ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
             ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
@@ -50,6 +51,7 @@ class hr_timesheet_report(osv.osv):
                 select
                     min(t.id) as id,
                     l.date as date,
+                    to_char(l.date, 'YYYY-MM-DD') as day,
                     to_char(l.date,'YYYY') as year,
                     to_char(l.date,'MM') as month,
                     sum(l.amount) as cost,
index 72d0e17..9c0588f 100644 (file)
@@ -21,7 +21,7 @@
                     <field name="year" invisible="1"/>
                     <field name="month" invisible="1"/>
                     <field name="date" invisible="1"/>
-
+                    <field name="day" invisible="1"/>
                     <field name="user_id" invisible="1"/>
                     <field name="company_id" invisible="1"/>
                     <field name="journal_id" invisible="1"/>
             <field name="arch" type="xml">
                 <search string="Timesheet">
                     <group col="10" colspan="12">
-                        <filter icon="terp-go-year" string="Year"
+                        <filter icon="terp-go-year" string=" Year "
                             name="year"
                             domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-01-01'))]"
                             help="Timesheet in current year"/>
-                        <filter icon="terp-go-month" string="Month"
+                        <filter icon="terp-go-month" string=" Month "
                             name="month"
                             domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-%%m-01'))]"
                             help="Timesheet in current month"/>
                         <filter icon="terp-go-month"
-                            string="Month-1"
+                            string=" Month-1 "
                             domain="[('date','&lt;=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]"
                             help="Timesheet of last month"/>
                         <separator orientation="vertical"/>
@@ -76,7 +76,7 @@
                         <filter string="General Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/>
                         <filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
                         <separator orientation="vertical"/>
-                        <filter string="Day" icon="terp-go-today" context="{'group_by':'date'}" help="Group by date"/>
+                        <filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Group by day of date"/>
                         <filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of date"/>
                         <filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of date"/>
                     </group>
index a786a12..43bc0d2 100644 (file)
             <field name="arch" type="xml">
                 <search string="Timesheet">
                     <group col="10" colspan="12">
-                        <filter icon="terp-go-week"
-                                string="    7 Days    "
-                                separator="1"
-                                domain="[('date_current','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date_current','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
-                                help="Timesheet during last 7 days"/>
-                        <filter icon="terp-go-month" string="This Month"
+                        <filter icon="terp-go-year" string=" Year "
+                                domain="[('date_current','&lt;=', time.strftime('%%Y-%%m-%%d')),('date_current','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
+                                help="Timesheet in current year"/>
+                        <filter icon="terp-go-month" string=" Month "
                                 name="month"
                                 domain="[('date_current','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date_current','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
-                                help="Timesheet in this month"/>
-                        <filter icon="terp-go-year" string="This Year"
-                                domain="[('date_current','&lt;=', time.strftime('%%Y-%%m-%%d')),('date_current','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
-                                help="Timesheet in this year"/>
+                                help="Timesheet in current month"/>
+                        <filter icon="terp-go-month"
+                            string=" Month-1 "
+                            domain="[('date_current','&lt;=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date_current','&gt;',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]"
+                            help="Timesheet of last month"/>
                         <separator orientation="vertical"/>
                         <filter icon="terp-document-new"
                                 string="Draft"
@@ -91,9 +90,9 @@
                         <separator orientation="vertical"/>
                         <filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
                         <separator orientation="vertical"/>
-                        <filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
-                        <filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
-                        <filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
+                        <filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Group by day of date"/>
+                        <filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of date"/>
+                        <filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of date"/>
                     </group>
                     <newline/>
                     <group expand="0" string="Extended Filters..." groups="base.group_extended">