summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorapa-tiny <apa@tinyerp.com>2010-04-19 11:15:05 +0530
committerapa-tiny <apa@tinyerp.com>2010-04-19 11:15:05 +0530
commit562500e72b2c71f833d6ea5e271b73a55d4e7bca (patch)
treeb3454726ec0b8b154e4acaec96f756ac84067f35
parent64db115f37123e1e299fc2cf13a0902c83e5feb0 (diff)
[IMP]:prject,hr_expense:Improved tasks and expense report.
bzr revid: apa@tinyerp.com-20100419054505-zlx1bo8wf95vdydb
-rw-r--r--addons/hr_expense/report/hr_expense_report.py8
-rw-r--r--addons/hr_expense/report/hr_expense_report_view.xml6
-rw-r--r--addons/project/report/project_report_view.xml6
3 files changed, 10 insertions, 10 deletions
diff --git a/addons/hr_expense/report/hr_expense_report.py b/addons/hr_expense/report/hr_expense_report.py
index 80a14ed648b..27f5c7c15da 100644
--- a/addons/hr_expense/report/hr_expense_report.py
+++ b/addons/hr_expense/report/hr_expense_report.py
@@ -63,15 +63,15 @@ class hr_expense_report(osv.osv):
create or replace view hr_expense_report as (
select
min(l.id) as id,
- s.date as date,
+ date_trunc('day',s.create_date) as date,
s.employee_id,
s.journal_id,
to_date(to_char(s.date_confirm, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_confirm,
to_date(to_char(s.date_valid, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_valid,
s.invoice_id,
s.department_id,
- to_char(s.date, 'YYYY') as year,
- to_char(s.date, 'MM') as month,
+ to_char(date_trunc('day',s.create_date), 'YYYY') as year,
+ to_char(date_trunc('day',s.create_date), 'MM') as month,
l.product_id as product_id,
sum(l.unit_quantity * u.factor) as product_qty,
s.user_id as user_id,
@@ -86,7 +86,7 @@ class hr_expense_report(osv.osv):
hr_expense_expense s on (s.id=l.expense_id)
left join product_uom u on (u.id=l.uom_id)
group by
- s.date,
+ date_trunc('day',s.create_date),
to_date(to_char(s.date_confirm, 'dd-MM-YYYY'),'dd-MM-YYYY'),
to_date(to_char(s.date_valid, 'dd-MM-YYYY'),'dd-MM-YYYY'),
l.product_id,
diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml
index bd948d451e1..3da247c5d46 100644
--- a/addons/hr_expense/report/hr_expense_report_view.xml
+++ b/addons/hr_expense/report/hr_expense_report_view.xml
@@ -47,16 +47,16 @@
<search string="Expenses">
<group>
<filter icon="terp-hr" string="This Year"
- domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
+ domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Expenses during last 7 year"/>
<filter icon="terp-hr" string="This Month"
name="month"
- domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d')), ('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
+ domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Expenses during last month"/>
<filter icon="gtk-media-rewind"
string=" 7 Days "
separator="1"
- domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d')), ('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
+ domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Expenses during last 7 days"/>
<separator orientation="vertical"/>
<filter string="Draft"
diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml
index b87ca4ef1f9..f643c06e313 100644
--- a/addons/project/report/project_report_view.xml
+++ b/addons/project/report/project_report_view.xml
@@ -52,16 +52,16 @@
<search string="Tasks">
<group>
<filter icon="terp-project" string="This Year"
- domain="[('date_start','&lt;', time.strftime('%%Y-%%m-%%d')),('date_start','&gt;=',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
+ domain="[('date_start','&lt;=', time.strftime('%%Y-%%m-%%d')),('date_start','&gt;=',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Tasks performed in this year"/>
<filter icon="terp-project" string="This Month"
name="month"
- domain="[('date_start','&lt;', time.strftime('%%Y-%%m-%%d')), ('date_start','&gt;=',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
+ domain="[('date_start','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date_start','&gt;=',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Tasks performed in this month"/>
<filter icon="gtk-media-rewind"
string=" 7 Days "
separator="1"
- domain="[('date_start','&lt;', time.strftime('%%Y-%%m-%%d')), ('date_start','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
+ domain="[('date_start','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date_start','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Tasks during last 7 days"/>
<separator orientation="vertical"/>
<filter string="Draft"