[MOD/IMP] hr_timesheet_sheet : Usability Improvements in Timesheet Sheet Analysis Report

bzr revid: dbr@tinyerp.com-20101008070438-zc0g5fxb6kko2jmq
This commit is contained in:
DBR (OpenERP) 2010-10-08 12:34:38 +05:30
parent 996e8d70fb
commit d270bee66a
3 changed files with 15 additions and 18 deletions

View File

@ -2,9 +2,5 @@
<openerp>
<data noupdate="1">
<record id="base.group_hr_contract" model="res.groups">
<field name="name">Human Resources / Contract</field>
</record>
</data>
</openerp>

View File

@ -35,7 +35,7 @@ class timesheet_report(osv.osv):
'name': fields.char('Description', size=64,readonly=True),
'product_id' : fields.many2one('product.product', 'Product'),
'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True),
'user_id': fields.many2one('res.users', 'User',readonly=True),
'employee_id': fields.many2one('hr.employee', 'Employee',readonly=True),
'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Type of Invoicing',readonly=True),
'account_id': fields.many2one('account.analytic.account', 'Analytic Account',readonly=True),
'nbr': fields.integer('#Nbr',readonly=True),
@ -60,8 +60,8 @@ class timesheet_report(osv.osv):
tools.drop_view_if_exists(cr, 'timesheet_report')
cr.execute("""
create or replace view timesheet_report as (
select
min(aal.id) as id,
select
min(aal.id) as id,
htss.date_current,
htss.name,
htss.date_from,
@ -91,14 +91,14 @@ class timesheet_report(osv.osv):
AND day.name = sheet.date_current) where sheet.id=htss.id) as total_attendance,
aal.to_invoice,
aal.general_account_id,
htss.user_id,
htss.employee_id as employee_id,
htss.company_id,
htss.department_id,
htss.state
from account_analytic_line as aal
left join hr_analytic_timesheet as hat ON (hat.line_id=aal.id)
left join hr_timesheet_sheet_sheet as htss ON (hat.line_id=htss.id)
group by
from hr_timesheet_sheet_sheet as htss
left join hr_analytic_timesheet as hat ON (hat.create_uid=htss.create_uid)
left join account_analytic_line as aal ON (hat.line_id=aal.id)
group by
to_char(htss.date_current,'YYYY'),
to_char(htss.date_current,'MM'),
to_char(htss.date_current, 'YYYY-MM-DD'),
@ -116,7 +116,8 @@ class timesheet_report(osv.osv):
htss.state,
htss.id,
htss.department_id,
htss.user_id
htss.employee_id
)
""")
timesheet_report()

View File

@ -7,7 +7,7 @@
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Timesheet" type="bar">
<field name="user_id" />
<field name="employee_id" />
<field name="quantity" operator = "+"/>
<field name="state" group = "True"/>
</graph>
@ -21,7 +21,7 @@
<tree colors="blue:state in ('draft');black:state in ('confirm','new');gray:state in('cancel')" string="Timesheet">
<field name="date_current" invisible="1"/>
<field name="name" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="employee_id" invisible="1"/>
<field name="date_from" invisible="1"/>
<field name="date_to" invisible="1"/>
<field name="state" invisible="1"/>
@ -72,7 +72,7 @@
domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
<field name="account_id"/>
<field name="user_id" />
<field name="employee_id" />
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
@ -90,7 +90,7 @@
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="User" name="User_id" icon="terp-personal" context="{'group_by':'user_id'}"/>
<filter string="Employee" name="Employee_id" icon="terp-personal" context="{'group_by':'employee_id'}"/>
<filter string="Department" icon="terp-personal+" context="{'group_by':'department_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
@ -117,7 +117,7 @@
<field name="res_model">timesheet.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_month':1,'search_default_User_id':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="context">{'search_default_month':1,'search_default_Employee_id':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="search_view_id" ref="view_timesheet_report_search"/>
</record>
<menuitem action="action_timesheet_report_stat_all" id="menu_timesheet_report_all"