resource/views/resource_calendar_leaves_views.xml

111 lines
5.4 KiB
XML
Raw Normal View History

2024-05-03 15:16:16 +03:00
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_resource_calendar_leaves_search" model="ir.ui.view">
<field name="name">resource.calendar.leaves.search</field>
<field name="model">resource.calendar.leaves</field>
<field name="arch" type="xml">
<search string="Search Working Period Time Off">
<field name="name"/>
<field name="resource_id"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="calendar_id"/>
<filter name="filter_date" date="date_from" default_period="this_year" string="Period"/>
<group expand="0" string="Group By">
<filter string="Resource" name="resource" domain="[]" context="{'group_by':'resource_id'}"/>
<filter string="Company" name="company" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Date" name="leave_month" domain="[]" context="{'group_by':'date_from'}" help="Starting Date of Time Off"/>
</group>
</search>
</field>
</record>
<record id="view_resource_calendar" model="ir.ui.view">
<field name="name">resource.calendar.leaves.calendar</field>
<field name="model">resource.calendar.leaves</field>
<field name="arch" type="xml">
<calendar date_start="date_from" date_stop="date_to" mode="month" string="Resource" color="resource_id" event_limit="5">
<field name="resource_id" avatar_field="image_128" filters="1"/>
<field name="company_id"/>
<field name="name"/>
</calendar>
</field>
</record>
<record id="resource_calendar_leave_form" model="ir.ui.view">
<field name="name">resource.calendar.leaves.form</field>
<field name="model">resource.calendar.leaves</field>
<field name="arch" type="xml">
<form string="Time Off Detail">
<field name="company_id" invisible="1"/>
<sheet>
<group>
<group name="leave_details">
<field name="name" string="Reason"/>
<field name="calendar_id"/>
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company" invisible="not calendar_id"/>
<field name="resource_id"/>
</group>
<group name="leave_dates">
<field name="date_from"/>
<field name="date_to"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="resource_calendar_leave_tree" model="ir.ui.view">
<field name="name">resource.calendar.leaves.tree</field>
<field name="model">resource.calendar.leaves</field>
<field name="priority">1</field>
<field name="arch" type="xml">
<tree string="Time Off Detail">
<field name="name" string="Reason"/>
<field name="resource_id" />
<field name="company_id" groups="base.group_multi_company" optional="hide"/>
<field name="calendar_id"/>
<field name="date_from" />
<field name="date_to" />
</tree>
</field>
</record>
<record id="action_resource_calendar_leave_tree" model="ir.actions.act_window">
<field name="name">Resource Time Off</field>
<field name="res_model">resource.calendar.leaves</field>
<field name="view_mode">tree,form,calendar</field>
<field name="search_view_id" ref="view_resource_calendar_leaves_search"/>
</record>
<record id="resource_calendar_leaves_action_from_calendar" model="ir.actions.act_window">
<field name="name">Resource Time Off</field>
<field name="res_model">resource.calendar.leaves</field>
<field name="view_mode">tree,form,calendar</field>
<field name="context">{
'default_calendar_id': active_id,
'search_default_calendar_id': active_id}</field>
<field name="search_view_id" ref="view_resource_calendar_leaves_search"/>
</record>
<record id="resource_calendar_closing_days" model="ir.actions.act_window">
<field name="name">Closing Days</field>
<field name="res_model">resource.calendar.leaves</field>
<field name="view_mode">calendar,tree,form</field>
<field name="domain">[('calendar_id','=',active_id), ('resource_id','=',False)]</field>
<field name="context">{'default_calendar_id': active_id}</field>
<field name="binding_model_id" ref="model_resource_calendar"/>
<field name="binding_view_types">form</field>
</record>
<record id="resource_calendar_resources_leaves" model="ir.actions.act_window">
<field name="name">Resources Time Off</field>
<field name="res_model">resource.calendar.leaves</field>
<field name="view_mode">calendar,tree,form</field>
<field name="domain">[('calendar_id','=',active_id), ('resource_id','!=',False)]</field>
<field name="context">{'default_calendar_id': active_id}</field>
<field name="binding_model_id" ref="model_resource_calendar"/>
<field name="binding_view_types">form</field>
</record>
</odoo>