odoo/addons/hr_holidays/report/available_holidays_view.xml

117 lines
6.5 KiB
XML

<?xml version="1.0"?>
<openerp>
<data>
<!-- available holidays report -->
<record id="view_hr_available_holidays_report_tree" model="ir.ui.view">
<field name="name">available.holidays.report.tree</field>
<field name="model">available.holidays.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Available Holidays">
<field name="employee_id"/>
<field name="category_id"/>
<field name="holiday_status_id"/>
<field name="department_id" invisible="1"/>
<field name="max_leave" sum="Allocated Leaves"/>
<field name="taken_leaves" sum="Taken Leaves"/>
<field name="user_id" invisible="1"/>
<field name="remaining_leave" sum="Remaining Leaves"/>
<field name="year" invisible="1"/>
<field name="day" invisible="1"/>
<field name="month" invisible="1"/>
<field name="date" invisible="1"/>
</tree>
</field>
</record>
<record id="view_hr_available_holidays_report_graph" model="ir.ui.view">
<field name="name">available.holidays.report.graph</field>
<field name="model">available.holidays.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="Available Holidays" type="bar">
<field name="employee_id"/>
<field name="max_leave" operator="+"/>
<field name="taken_leaves" operator="+"/>
<field name="remaining_leave" operator="+"/>
<field group="True" name="holiday_status_id"/>
</graph>
</field>
</record>
<record id="view_hr_available_holidays_report_search" model="ir.ui.view">
<field name="name">available.holidays.report.search</field>
<field name="model">available.holidays.report</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Leaves">
<group>
<filter icon="terp-personal" string="Employee" domain="[('category_id', '=', False)]"
help="Leaves by empolyee"/>
<filter icon="terp-stock_symbol-selection" string="Category"
domain="[('employee_id', '=', False)]" help="Leaves by category"/>
<separator orientation="vertical"/>
<filter icon="terp-go-year" string="This Year"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Leaves in this year"/>
<filter icon="terp-go-month" 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'))]" help="Leaves in this month"/>
<filter icon="terp-go-week" 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'))]" help="Leaves during last 7 days"/>
<separator orientation="vertical"/>
<field name="employee_id"/>
<field name="user_id" widget="selection">
<filter icon="terp-personal" string="My Leaves" domain="[('user_id','=',uid)]"/>
</field>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<field name="holiday_status_id" widget="selection"/>
<field name="department_id" widget="selection"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="10" col="12">
<filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Type" icon="terp-stock_symbol-selection" context="{'group_by':'holiday_status_id'}"/>
<filter string="Department" icon="terp-personal+" context="{'group_by':'department_id'}"/>
<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'}"/>
</group>
</search>
</field>
</record>
<record id="action_hr_available_holidays_report" model="ir.actions.act_window">
<field name="name">Available Holidays</field>
<field name="res_model">available.holidays.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':1,'group_by':[], "search_default_user_id": uid}</field>
<field name="view_id" ref="view_hr_available_holidays_report_search"/>
</record>
<record model="ir.actions.act_window.view" id="action_hr_available_holidays_report_tree">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_hr_available_holidays_report_tree"/>
<field name="act_window_id" ref="action_hr_available_holidays_report"/>
</record>
<record model="ir.actions.act_window.view" id="action_hr_available_holidays_report_graph">
<field name="sequence" eval="2"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_hr_available_holidays_report_graph"/>
<field name="act_window_id" ref="action_hr_available_holidays_report"/>
</record>
<menuitem name="Available Holidays" id="menu_hr_available_holidays_report_tree" action="action_hr_available_holidays_report" parent="menu_hr_reporting_holidays"/>
</data>
</openerp>