_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),
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,
<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','<=', 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"/>
<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>
<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"
<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">