You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

211 lines
9.2 KiB

<odoo>
<record model="ir.ui.view" id="task_view_tree">
<field name="name">Shift List</field>
<field name="model">beesdoo.shift.shift</field>
<field name="arch" type="xml">
<tree>
<field name="start_time" />
<field name="planning_id" />
<field name="task_type_id" />
<field name="name" />
<field name="super_coop_id" />
<field name="worker_id" />
<field name="replaced_id" />
<field name="end_time" />
<field name="stage_id" />
</tree>
</field>
</record>
<record model="ir.ui.view" id="task_view_search">
<field name="name">Shift Search</field>
<field name="model">beesdoo.shift.shift</field>
<field name="arch" type="xml">
<search>
<field name="planning_id" />
<field name="task_type_id" />
<field name="name" />
<field name="super_coop_id" />
<field name="worker_id" />
<group>
<filter string="My Team Shift"
domain="[('super_coop_id', '=', uid)]" />
<filter string="My Shift"
domain="[('worker_id.user_ids', 'in', uid)]" />
</group>
<group>
<filter string="Assigned" name="assigned"
domain="[('worker_id', '!=', False)]" />
<filter string="Unassigned" name="unassigned"
domain="[('worker_id', '=', False)]" />
</group>
<group>
<filter string="Today" name="today"
domain="[('end_time','&gt;', context_today().strftime('%%Y-%%m-%%d 00:00:00')), ('start_time','&lt;', context_today().strftime('%%Y-%%m-%%d 23:59:59'))]" />
<filter string="Attendance" name="attendance"
domain="[('end_time','&gt;', context_today().strftime('%%Y-%%m-%%d 00:00:00')), ('start_time','&lt;', context_today().strftime('%%Y-%%m-%%d 23:59:59')), ('worker_id', '!=', False)]" />
</group>
<filter string="Shift Template"
context="{'group_by' : 'task_template_id'}" />
<filter string="Type" name="gb_type"
context="{'group_by' : 'task_type_id'}" />
<filter string="Status" name="gb_status"
context="{'group_by' : 'stage_id'}" />
<filter string="Day" name="gb_day"
context="{'group_by' : 'start_time:day'}" />
</search>
</field>
</record>
<record model="ir.ui.view" id="task_view_calendar">
<field name="name">Task Template List</field>
<field name="model">beesdoo.shift.shift</field>
<field name="arch" type="xml">
<calendar string="Calendar View" date_start="start_time"
date_stop="end_time" color="task_type_id">
<field name="name" />
<field name="super_coop_id" />
<field name="worker_id" />
</calendar>
</field>
</record>
<record model="ir.ui.view" id="task_view_form">
<field name="name">Task Template Form</field>
<field name="model">beesdoo.shift.shift</field>
<field name="arch" type="xml">
<form>
<header>
<field name="stage_id" widget="statusbar"
clickable="1" />
</header>
<sheet>
<div class="oe_title">
<h1>
<field name="name" />
</h1>
</div>
<group>
<group>
<field name="task_template_id" />
<field name="task_type_id" />
<field name="super_coop_id" />
<field name="worker_id" />
<field name="replaced_id" attrs="{'invisible': [('is_regular', '!=', True)]}"/>
<field name="is_regular" />
</group>
<group>
<field name="start_time" />
<field name="end_time" />
<field name="revert_info" invisible="0" />
</group>
</group>
</sheet>
<!-- Solution Ex1 -->
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="message_ids" widget="mail_thread" />
</div>
</form>
</field>
</record>
<record model="ir.ui.view" id="task_shift_view_kanban">
<field name="name">Shift Kanban</field>
<field name="model">beesdoo.shift.shift</field>
<field name="arch" type="xml">
<kanban>
<field name="color" />
<field name="task_type_id" />
<field name="name" />
<field name="stage_id" />
<field name="worker_id" />
<field name="super_coop_id" />
<field name="is_regular" />
<templates>
<t t-name="kanban-box">
<div
t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
<div class="o_dropdown_kanban dropdown"
groups="base.group_user">
<a class="dropdown-toggle btn"
data-toggle="dropdown" href="#">
<span class="fa fa-bars fa-lg" />
</a>
<ul class="dropdown-menu" role="menu"
aria-labelledby="dLabel">
<t t-if="widget.editable">
<li>
<a type="edit">Edit Shift</a>
</li>
</t>
</ul>
</div>
<div class="oe_kanban_content">
<strong>
<field name="name" />
</strong>
<div>
<field name="start_time"
widget="datetime" />
-
<field name="end_time" widget="datetime" />
</div>
<div>
Status:
<field name="stage_id" />
</div>
<div t-if="record.task_type_id.raw_value">
Type:
<field name="task_type_id" />
</div>
<div>
Worker:
<field name="worker_id" />
</div>
<div t-if="record.super_coop_id.raw_value">
Super Coop:
<field name="super_coop_id" />
</div>
<div t-if="record.is_regular.raw_value" >
Regular Shift
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- Actions -->
<record model="ir.actions.act_window" id="action_task">
<field name="name">Task Action</field>
<field name="res_model">beesdoo.shift.shift</field>
<field name="view_mode">kanban,calendar,tree,form,pivot</field>
<field name="context">{'search_default_today': 1,
'search_default_gb_type':1}</field>
</record>
<record model="ir.actions.act_window" id="action_task_attendance">
<field name="name">Shift Attendance</field>
<field name="res_model">beesdoo.shift.shift</field>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{'search_default_attendance': 1,
'search_default_gb_status':1}</field>
</record>
<!-- Top menu item -->
<menuitem name="Planning" id="menu_task_top" parent="menu_root"
sequence="1" />
<!-- actions -->
<menuitem name="Shift" id="menu_task" parent="menu_task_top"
action="action_task" groups="beesdoo_shift.group_shift_management" />
<menuitem name="Shift Attendance" id="menu_task_attendance"
parent="menu_task_top" action="action_task_attendance" />
</odoo>