flectra/addons/sale_timesheet/views/hr_timesheet_views.xml
2018-01-16 02:34:37 -08:00

122 lines
5.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<flectra>
<record id="timesheet_view_search" model="ir.ui.view">
<field name="name">account.analytic.line.search</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_search"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='month']" position="after">
<field name="timesheet_invoice_type"/>
<field name="timesheet_invoice_id"/>
<separator/>
<filter name="billable_time" string="Billable Hours" domain="[('timesheet_invoice_type', '=', 'billable_time')]"/>
<filter name="billable_fixed" string="Fixed Price Projects" domain="[('timesheet_invoice_type', '=', 'billable_fixed')]"/>
<filter name="non_billable" string="Non Billable Hours" domain="[('timesheet_invoice_type', '=', 'non_billable')]"/>
</xpath>
</field>
</record>
<record id="timesheet_view_pivot_revenue" model="ir.ui.view">
<field name="name">account.analytic.line.pivot.revenue</field>
<field name="model">account.analytic.line</field>
<field name="arch" type="xml">
<pivot string="Timesheet">
<field name="employee_id" type="row"/>
<field name="date" interval="month" type="col"/>
<field name="timesheet_revenue" type="measure"/>
</pivot>
</field>
</record>
<!--
Reporting
-->
<record id="timesheet_action_billing_report" model="ir.actions.act_window">
<field name="name">By Billing Rate</field>
<field name="res_model">account.analytic.line</field>
<field name="view_mode">pivot,graph</field>
<field name="domain">[('project_id', '!=', False)]</field>
<field name="context">{"search_default_week":1}</field>
<field name="search_view_id" ref="hr_timesheet.hr_timesheet_line_search"/>
</record>
<record id="timesheet_filter_billing" model="ir.filters">
<field name="name">Billing Rate</field>
<field name="model_id">account.analytic.line</field>
<field name="user_id" eval="False"/>
<field name="domain">[('project_id', '!=', False)]</field>
<field name="is_default" eval="True"/>
<field name="context">{
'col_group_by': ['date:month', 'timesheet_invoice_type'],
'group_by': ['project_id', 'employee_id'],
'measures': ['timesheet_revenue', 'amount_currency', 'unit_amount', '__count']
}</field>
<field name="action_id" ref="timesheet_action_billing_report"/>
</record>
<menuitem id="menu_timesheet_billing_analysis"
parent="hr_timesheet.menu_timesheets_reports_timesheet"
action="timesheet_action_billing_report"
name="By Billing Rate"
sequence="40"/>
<record id="timesheet_action_report_cost_revenue" model="ir.actions.act_window">
<field name="name">Costs and Revenues</field>
<field name="res_model">account.analytic.line</field>
<field name="search_view_id" ref="hr_timesheet.hr_timesheet_line_search"/>
<field name="domain">[('project_id', '!=', False)]</field>
<field name="context">{
'search_default_groupby_project':1,
'search_default_groupby_employee':2,
}</field>
</record>
<record id="timesheet_action_report_cost_revenue_pivot" model="ir.actions.act_window.view">
<field name="sequence" eval="5"/>
<field name="view_mode">pivot</field>
<field name="view_id" ref="timesheet_view_pivot_revenue"/>
<field name="act_window_id" ref="timesheet_action_report_cost_revenue"/>
</record>
<record id="timesheet_action_report_cost_revenue_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="10"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="hr_timesheet.timesheet_view_tree_user"/>
<field name="act_window_id" ref="timesheet_action_report_cost_revenue"/>
</record>
<record id="timesheet_action_report_cost_revenue_form" model="ir.actions.act_window.view">
<field name="sequence" eval="15"/>
<field name="view_mode">form</field>
<field name="view_id" ref="hr_timesheet.timesheet_view_form_user"/>
<field name="act_window_id" ref="timesheet_action_report_cost_revenue"/>
</record>
<menuitem id="menu_timesheet_report_cost_revenue"
parent="hr_timesheet.menu_timesheets_reports"
action="timesheet_action_report_cost_revenue"
name="Costs and Revenues"
sequence="50"/>
<!--
Plan
-->
<record id="timesheet_action_plan_pivot" model="ir.actions.act_window">
<field name="name">Timesheet</field>
<field name="res_model">account.analytic.line</field>
<field name="view_mode">pivot,tree,form</field>
<field name="domain">[('project_id', '!=', False)]</field>
<field name="search_view_id" ref="hr_timesheet.hr_timesheet_line_search"/>
</record>
<record id="timesheet_action_from_plan" model="ir.actions.act_window">
<field name="name">Timesheet</field>
<field name="res_model">account.analytic.line</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('project_id', '!=', False)]</field>
<field name="search_view_id" ref="hr_timesheet.hr_timesheet_line_search"/>
</record>
</flectra>