diff options
| author | DBR (OpenERP) <dbr@tinyerp.com> | 2010-09-23 17:33:23 +0530 |
|---|---|---|
| committer | DBR (OpenERP) <dbr@tinyerp.com> | 2010-09-23 17:33:23 +0530 |
| commit | 17c8331fcdb3465ec5cfcf60c100bfced2ead3f2 (patch) | |
| tree | 22da387333da5e3474d0fa18dce7bfe0085ec8c9 | |
| parent | a1bfb7d6df3e560997bd2b7c5c4c4da678d80be5 (diff) | |
| parent | 7e0e4f538125cfe562d1d39f3c63ff1024348dc7 (diff) | |
[Merge]
bzr revid: dbr@tinyerp.com-20100923120323-75n5u3388zb8goaa
3 files changed, 19 insertions, 18 deletions
diff --git a/addons/hr_timesheet_sheet/report/hr_timesheet_report.py b/addons/hr_timesheet_sheet/report/hr_timesheet_report.py index 100041ca35a..84ef868ab81 100644 --- a/addons/hr_timesheet_sheet/report/hr_timesheet_report.py +++ b/addons/hr_timesheet_sheet/report/hr_timesheet_report.py @@ -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, diff --git a/addons/hr_timesheet_sheet/report/hr_timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/hr_timesheet_report_view.xml index 72d0e177fea..9c0588f618e 100644 --- a/addons/hr_timesheet_sheet/report/hr_timesheet_report_view.xml +++ b/addons/hr_timesheet_sheet/report/hr_timesheet_report_view.xml @@ -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"/> @@ -41,16 +41,16 @@ <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','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',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','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',time.strftime('%%Y-%%m-01'))]" help="Timesheet in current month"/> <filter icon="terp-go-month" - string="Month-1" + string=" Month-1 " domain="[('date','<=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date','>',(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> diff --git a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml index a786a123529..43bc0d2b9cc 100644 --- a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml +++ b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml @@ -49,18 +49,17 @@ <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','<=', time.strftime('%%Y-%%m-%%d')), ('date_current','>',(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','<=', time.strftime('%%Y-%%m-%%d')),('date_current','>',(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','<=', time.strftime('%%Y-%%m-%%d')), ('date_current','>',(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','<=', time.strftime('%%Y-%%m-%%d')),('date_current','>',(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','<=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date_current','>',(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"> |
