[IMP] improves the Timesheet Analysis reporting view : changes the axis, adds a 'this month' filter using the new pivot graph view (addon hr_timesheet_sheet)
bzr revid: ged@openerp.com-20140127130351-iu422fkjnu8059wd
This commit is contained in:
parent
fcb9f7a76e
commit
68a466e8a8
|
@ -29,11 +29,6 @@ class hr_timesheet_report(osv.osv):
|
|||
_description = "Timesheet"
|
||||
_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),
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'name': fields.char('Description', size=64,readonly=True),
|
||||
'product_id' : fields.many2one('product.product', 'Product',readonly=True),
|
||||
|
@ -53,9 +48,6 @@ 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,
|
||||
sum(l.unit_amount) as quantity,
|
||||
l.account_id as account_id,
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<graph string="Timesheet" type="pivot">
|
||||
<field name="user_id" type="row"/>
|
||||
<field name="date" interval="day" type="col"/>
|
||||
<field name="quantity" type="measure"/>
|
||||
</graph>
|
||||
</field>
|
||||
|
@ -16,6 +17,7 @@
|
|||
<field name="model">hr.timesheet.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Timesheet">
|
||||
<filter icon="terp-go-year" string="This Month" name="month" domain="[('date','<=', time.strftime('%Y-%m-%d')),('date','>=',time.strftime('%Y-%m-01'))]" help="month"/>
|
||||
<field name="account_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="user_id"/>
|
||||
<group expand="0" string="Extended Filters...">
|
||||
|
@ -31,9 +33,9 @@
|
|||
<filter string="Analytic Account" icon="terp-folder-green" context="{'group_by':'account_id'}" groups="analytic.group_analytic_accounting"/>
|
||||
<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"/>
|
||||
<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"/>
|
||||
<filter string="Date (day)" context="{'group_by':'date:day'}" help="Group by day of date"/>
|
||||
<filter string="Date (month)" context="{'group_by':'date:month'}" help="Group by month of date"/>
|
||||
<filter string="Date (year)" context="{'group_by':'date:year'}" help="Group by year of date"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
@ -44,7 +46,7 @@
|
|||
<field name="res_model">hr.timesheet.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph</field>
|
||||
<field name="context">{'search_default_year':1,'search_default_month':1,'search_default_group_user_id':1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="context">{'search_default_month':1,'search_default_group_user_id':1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="help" type="html">
|
||||
<p>
|
||||
This report performs analysis on timesheets created by your
|
||||
|
|
Loading…
Reference in New Issue