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.
 
 
 
 
 

231 lines
12 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" />
<filter string="My Team Shift"
domain="[('super_coop_id', '=', uid)]"
name="team_shift"/>
<filter string="My Shift"
domain="[('worker_id.user_ids', 'in', uid)]"
name="shift" />
<separator />
<filter string="Assigned" name="assigned"
domain="[('worker_id', '!=', False)]" />
<filter string="Unassigned" name="unassigned"
domain="[('worker_id', '=', False)]" />
<separator />
<filter string="4 next days" name="nextweek"
domain="[('end_time','&gt;', context_today().strftime('%%Y-%%m-%%d 00:00:00')), ('start_time','&lt;', (context_today() + datetime.timedelta(days=4)).strftime('%%Y-%%m-%%d 23:59:59'))]" />
<filter string="J-5" name="jminus5"
domain="[('end_time','&gt;', (context_today() - datetime.timedelta(days=5)).strftime('%%Y-%%m-%%d 00:00:00')), ('start_time','&lt;', (context_today() - datetime.timedelta(days=5)).strftime('%%Y-%%m-%%d 23:59:59'))]" />
<filter string="J-4" name="jminus4"
domain="[('end_time','&gt;', (context_today() - datetime.timedelta(days=4)).strftime('%%Y-%%m-%%d 00:00:00')), ('start_time','&lt;', (context_today() - datetime.timedelta(days=4)).strftime('%%Y-%%m-%%d 23:59:59'))]" />
<filter string="J-3" name="jminus3"
domain="[('end_time','&gt;', (context_today() - datetime.timedelta(days=3)).strftime('%%Y-%%m-%%d 00:00:00')), ('start_time','&lt;', (context_today() - datetime.timedelta(days=3)).strftime('%%Y-%%m-%%d 23:59:59'))]" />
<filter string="J-2" name="jminus2"
domain="[('end_time','&gt;', (context_today() - datetime.timedelta(days=2)).strftime('%%Y-%%m-%%d 00:00:00')), ('start_time','&lt;', (context_today() - datetime.timedelta(days=2)).strftime('%%Y-%%m-%%d 23:59:59'))]" />
<filter string="J-1" name="jminus1"
domain="[('end_time','&gt;', (context_today() - datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d 00:00:00')), ('start_time','&lt;', (context_today() - datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d 23:59:59'))]" />
<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'))]" />
<group expand="1" string="Group By">
<filter string="Shift Template"
context="{'group_by' : 'task_template_id'}"
name="shift_template" />
<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'}" />
</group>
</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" domain="[('cooperative_status_ids.status', 'not in', ('unsubscribed', 'resigning'))]"/>
<field name="worker_id" options="{'no_create': True, 'no_open': True}" domain="[('cooperative_status_ids.status', 'not in', ('unsubscribed', 'resigning'))]"/>
<field name="replaced_id"
options="{'no_create': True, 'no_open': True}"
domain="[('working_mode', '=', 'regular')]"
attrs="{'invisible': [('working_mode', '!=', 'regular')]}" />
<field name="is_regular"
attrs="{'invisible': [('working_mode', '!=', 'regular')]}"/>
<field name="is_compensation"
attrs="{'invisible': [('working_mode', '!=', 'regular')]}"/>
<field name="working_mode" invisible="1"/>
</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">
<!-- Following block raises a warning -->
<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_assigned': 1,
'search_default_today': 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>