flectra/addons/maintenance/views/maintenance_views.xml

1036 lines
52 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<flectra>
<!-- equiment.request : views -->
<record id="hr_equipment_request_view_search" model="ir.ui.view">
<field name="name">equipment.request.search</field>
<field name="model">maintenance.request</field>
<field name="arch" type="xml">
<search string="maintenance Request Search">
<field name="name"/>
<field name="category_id"/>
<field name="technician_user_id"/>
<field name="equipment_id"/>
<field name="owner_user_id"/>
<field name="stage_id"/>
<field name="maintenance_team_id"/>
<separator/>
<filter string="To do" domain="[('stage_id.done', '=', False)]" name="todo"/>
<filter string="Blocked" name="kanban_state_block" domain="[('kanban_state', '=', 'blocked')]"/>
<filter string="In Progress" name="progress" domain="[('kanban_state', '=', 'normal')]"/>
<filter string="Done" name="done" domain="[('kanban_state', '=', 'done')]"/>
<filter string="Top Priorities" name="top_priority" domain="[('priority', '=', '3')]"/>
<separator/>
<filter string="Unscheduled Maintenance" domain="[('schedule_date', '=', False)]" name="unscheduled"/>
<separator/>
<filter string="My Requests" name="my_requests" domain="[('technician_user_id', '=', uid)]"/>
<separator/>
<filter string="My Activities" name="activities_my"
domain="[('activity_ids.user_id', '=', uid)]"/>
<separator/>
<filter string="Late Activities" name="activities_overdue"
domain="[('activity_ids.date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
<filter string="Today Activities" name="activities_today"
domain="[('activity_ids.date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter string="Future Activities" name="activities_upcoming_all"
domain="[('activity_ids.date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))
]"/>
<separator/>
<filter string="Unread Messages" name="message_needaction" domain="[('message_needaction','=',True)]"/>
<separator/>
<filter string="Archived" name="inactive" domain="[('archive','=',True)]"/>
<group expand='0' string='Group by...'>
<filter string='Assigned' domain="[]" context="{'group_by': 'technician_user_id'}"/>
<filter string='Category' domain="[]" context="{'group_by' : 'category_id'}"/>
<filter string='Stages' domain="[]" context="{'group_by' : 'stage_id'}"/>
<filter string='Created By' name='created_by' domain="[]" context="{'group_by': 'owner_user_id'}"/>
</group>
</search>
</field>
</record>
<record id="hr_equipment_request_view_form" model="ir.ui.view">
<field name="name">equipment.request.form</field>
<field name="model">maintenance.request</field>
<field name="arch" type="xml">
<form string="Maintenance Request">
<header>
<button string="Cancel" name="archive_equipment_request" type="object" attrs="{'invisible': [('archive', '=', True)]}"/>
<button string="Reopen Request" name="reset_equipment_request" type="object" attrs="{'invisible': [('archive', '=', False)]}"/>
<field name="stage_id" widget="statusbar" clickable="true" attrs="{'invisible': [('archive', '=', True)]}"/>
</header>
<sheet>
<div attrs="{'invisible': [('archive', '=', False)]}">
<span class="label label-warning pull-right">Canceled</span>
</div>
<div class="oe_right">
<field name="kanban_state" class="oe_inline" widget="state_selection"/>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Name"/>
<h1>
<field name="name" placeholder="Maintenance Request"/>
</h1>
</div>
<group>
<group>
<field name="owner_user_id" string="Requested By"/>
<field name="equipment_id" context="{'default_category_id':category_id}"/>
<field name="category_id" groups="maintenance.group_equipment_manager" attrs="{'invisible': [('equipment_id', '=', False)]}"/>
<field name="request_date" readonly="True"/>
<field name="close_date" groups="base.group_no_one" readonly="True"/>
<field name="archive" invisible="1"/>
<field name="maintenance_type" widget="radio"/>
</group>
<group>
<field name="maintenance_team_id" options="{'no_create': True, 'no_open': True}"/>
<field name="technician_user_id" string="Responsible"/>
<label for="schedule_date"/>
<div class="o_row">
<field name="schedule_date"/>
<label string="for"/>
<field name="duration" class="oe_inline"/> hours
</div>
<field name="priority" widget="priority"/>
</group>
</group>
<field name='description' placeholder="Internal Note ......."/>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record id="hr_equipment_request_view_kanban" model="ir.ui.view">
<field name="name">equipment.request.kanban</field>
<field name="model">maintenance.request</field>
<field name="arch" type="xml">
<kanban default_group_by="stage_id">
<field name="stage_id"/>
<field name="color"/>
<field name="priority"/>
<field name="equipment_id"/>
<field name="technician_user_id"/>
<field name="owner_user_id"/>
<field name="category_id"/>
<field name="kanban_state"/>
<field name="message_needaction_counter"/>
<field name="activity_ids" />
<field name="activity_state" />
<templates>
<t t-name="kanban-tooltip">
<ul class="oe_kanban_tooltip">
<li><b>Category:</b> <field name="category_id"/></li>
<li><b>Request to:</b> <field name="technician_user_id"/></li>
</ul>
</t>
<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 oe_semantic_html_override">
<div class="o_dropdown_kanban dropdown">
<a class="dropdown-toggle btn" data-toggle="dropdown" href="#" >
<span class="fa fa-ellipsis-v"/>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<t t-if="widget.editable"><li><a type="edit">Edit...</a></li></t>
<t t-if="widget.deletable"><li><a type="delete">Delete</a></li></t>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
</div>
<div class="oe_kanban_content" tooltip="kanban-tooltip">
<div class="o_kanban_record_top">
<b class="o_kanban_record_title"><field name="name"/></b>
</div>
<div class="o_kanban_record_body">
<span name="owner_user_id" t-if="record.owner_user_id.raw_value">Requested by : <field name="owner_user_id"/><br/></span>
<span name="technician_user_id" t-if="record.technician_user_id.raw_value">Responsible : <field name="technician_user_id"/><br/></span>
<span class="oe_grey" t-if="record.equipment_id.raw_value"><field name="equipment_id"/><br/></span>
<span t-if="record.category_id.raw_value"><field name="category_id"/></span>
</div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left">
<field name="priority" widget="priority"/>
<t t-if="record.message_needaction_counter.raw_value">
<span class='oe_kanban_mail_new' title='Unread Messages'><i class='fa fa-comments'/><t t-raw="record.message_needaction_counter.raw_value"/></span>
</t>
<div class="o_kanban_inline_block ml4 mr4">
<field name="activity_ids" widget="kanban_activity" />
</div>
</div>
<div class="oe_kanban_bottom_right">
<field name="kanban_state" widget="state_selection"/>
<img t-att-src="kanban_image('res.users', 'image_small', record.technician_user_id.raw_value)" t-att-title="record.technician_user_id.value" width="24" height="24" class="oe_kanban_avatar pull-right"/>
</div>
</div>
</div>
<div class="oe_clear"></div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="hr_equipment_request_view_tree" model="ir.ui.view">
<field name="name">equipment.request.tree</field>
<field name="model">maintenance.request</field>
<field name="arch" type="xml">
<tree string="maintenance Request" decoration-bf="message_needaction==True">
<field name="message_needaction" invisible="1"/>
<field name="name"/>
<field name="request_date" groups="base.group_no_one"/>
<field name="owner_user_id"/>
<field name="technician_user_id"/>
<field name="category_id" groups="maintenance.group_equipment_manager"/>
<field name="stage_id"/>
</tree>
</field>
</record>
<record id="hr_equipment_request_view_graph" model="ir.ui.view">
<field name="name">equipment.request.graph</field>
<field name="model">maintenance.request</field>
<field name="arch" type="xml">
<graph string="maintenance Request">
<field name="technician_user_id"/>
<field name="stage_id"/>
</graph>
</field>
</record>
<record id="hr_equipment_request_view_pivot" model="ir.ui.view">
<field name="name">equipment.request.pivot</field>
<field name="model">maintenance.request</field>
<field name="arch" type="xml">
<pivot string="maintenance Request">
<field name="technician_user_id"/>
<field name="stage_id"/>
</pivot>
</field>
</record>
<record id="hr_equipment_view_calendar" model="ir.ui.view">
<field name="name">equipment.request.calendar</field>
<field name="model">maintenance.request</field>
<field name="arch" type="xml">
<calendar date_start="schedule_date" date_delay="duration" color="technician_user_id">
<field name="name"/>
<field name="technician_user_id"/>
</calendar>
</field>
</record>
<!-- equiment.request : actions -->
<record id="hr_equipment_request_action" model="ir.actions.act_window">
<field name="name">Maintenance Requests</field>
<field name="res_model">maintenance.request</field>
<field name="view_mode">kanban,tree,form,pivot,graph,calendar</field>
<field name="view_id" ref="hr_equipment_request_view_kanban"/>
<field name="context">{'default_technician_user_id': uid}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a new maintenance request.
</p><p>
Follow the process of the request and communicate with the collaborator.
</p>
</field>
</record>
<record id="hr_equipment_request_action_link" model="ir.actions.act_window">
<field name="name">Maintenance Requests</field>
<field name="res_model">maintenance.request</field>
<field name="view_mode">kanban,tree,form,pivot,graph,calendar</field>
<field name="search_view_id" ref="hr_equipment_request_view_search"/>
<field name="view_id" ref="hr_equipment_request_view_kanban"/>
<field name="context">{
'search_default_category_id': [active_id],
'default_category_id': active_id,
}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a new maintenance request.
</p><p>
Follow the process of the request and communicate with the collaborator.
</p>
</field>
</record>
<record id="hr_equipment_request_action_from_equipment" model="ir.actions.act_window">
<field name="name">Maintenance Requests</field>
<field name="res_model">maintenance.request</field>
<field name="src_model">maintenance.equipment</field>
<field name="view_mode">kanban,tree,form,pivot,graph,calendar</field>
<field name="context">{
'default_equipment_id': active_id,
}</field>
<field name="domain">[('equipment_id', '=', active_id)]</field>
</record>
<record id="hr_equipment_todo_request_action_from_dashboard" model="ir.actions.act_window">
<field name="name">Maintenance Requests</field>
<field name="res_model">maintenance.request</field>
<field name="view_mode">kanban,tree,form,pivot,graph,calendar</field>
<field name="context">{
'default_maintenance_team_id': active_id,
}</field>
<field name="domain">[('maintenance_team_id', '=', active_id), ('maintenance_type', 'in', context.get('maintenance_type', ['preventive', 'corrective']))]</field>
</record>
<record id="hr_equipment_request_action_cal" model="ir.actions.act_window">
<field name="name">Maintenance Requests</field>
<field name="res_model">maintenance.request</field>
<field name="view_mode">calendar,kanban,tree,form,pivot,graph</field>
<field name="view_id" ref="hr_equipment_view_calendar"/>
</record>
<record id="maintenance_request_action_reports" model="ir.actions.act_window">
<field name="name">Maintenance Requests</field>
<field name="res_model">maintenance.request</field>
<field name="view_mode">graph,pivot,kanban,tree,form,calendar</field>
<field name="help" type="html">
<p>
No maintenance request.
</p>
</field>
</record>
<!-- equiment : views -->
<record id="hr_equipment_view_form" model="ir.ui.view">
<field name="name">equipment.form</field>
<field name="model">maintenance.equipment</field>
<field name="arch" type="xml">
<form string="Equipments">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="%(hr_equipment_request_action_from_equipment)d"
type="action"
class="oe_stat_button"
icon="fa-ticket">
<field string="Maintenance" name="maintenance_count" widget="statinfo"/>
</button>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name" string="Name" placeholder="Equipment Name"/></h1>
</div>
<group>
<group>
<field name="category_id" options="{&quot;no_open&quot;: True}"/>
<field name="owner_user_id" string="Owner"/>
</group>
<group>
<field name="maintenance_team_id" attrs="{'required': [('period', '!=', 0)]}"/>
<field name="technician_user_id"/>
<field name="assign_date" groups="base.group_no_one"/>
<field name="scrap_date" groups="base.group_no_one"/>
<field name="location" string="Used in location"/>
</group>
</group>
<notebook>
<page string="Description">
<field name="note"/>
</page>
<page string="Product Information">
<group>
<group>
<field name="partner_id" context="{'default_supplier': True, 'default_customer': False}"/>
<field name="partner_ref"/>
<field name="model"/>
<field name="serial_no"/>
</group><group>
<field name="cost" groups="maintenance.group_equipment_manager"/>
<field name="warranty"/>
</group>
</group>
</page>
<page string="Maintenance">
<group>
<group name="maintenance">
<field name="next_action_date" class="oe_read_only" string="Next Preventive Maintenance"/>
<label for="period" string="Preventive Maintenance Frequency"/>
<div class="o_row">
<field name="period"/> days
</div>
<label for="maintenance_duration" string="Maintenance Duration"/>
<div class="o_row">
<field name="maintenance_duration"/> hours
</div>
</group>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record id="hr_equipment_view_kanban" model="ir.ui.view">
<field name="name">equipment.kanban</field>
<field name="model">maintenance.equipment</field>
<field name="arch" type="xml">
<kanban>
<field name="name"/>
<field name="color"/>
<field name="technician_user_id"/>
<field name="owner_user_id"/>
<field name="category_id"/>
<field name="serial_no"/>
<field name="model"/>
<field name="maintenance_ids"/>
<field name="maintenance_open_count"/>
<field name="next_action_date"/>
<field name="technician_user_id"/>
<field name="activity_ids" />
<field name="activity_state" />
<templates>
<t t-name="kanban-tooltip">
<ul class="oe_kanban_tooltip">
<li><b>Serial Number:</b> <field name="serial_no"/></li>
<li><b>Model Number:</b> <field name="model"/></li>
</ul>
</t>
<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">
<a class="dropdown-toggle btn" data-toggle="dropdown" href="#" >
<span class="fa fa-ellipsis-v"/>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<t t-if="widget.editable"><li><a type="edit">Edit...</a></li></t>
<t t-if="widget.deletable"><li><a type="delete">Delete</a></li></t>
<li class="divider"></li>
<li class="dropdown-header">Record Colour</li>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
</div>
<div class="oe_kanban_content" tooltip="kanban-tooltip">
<div class="o_kanban_record_top">
<b class="o_kanban_record_title"><field name="name"/><small><span t-if="record.model.raw_value"> (<field name="model"/>)</span></small></b>
</div>
<div class="o_kanban_record_body">
<div t-if="record.serial_no.raw_value"><field name="serial_no"/></div>
<div t-if="!record.owner_user_id.raw_value">Unassigned</div>
<div t-if="record.owner_user_id.raw_value"><field name="owner_user_id"/></div>
</div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left">
<div class="label label-danger" t-if="record.maintenance_open_count.raw_value" >
<t t-raw="record.maintenance_open_count.raw_value"/> Request
</div>
<div class="label label-default" t-if="record.next_action_date.raw_value" >
<t t-raw="moment(record.next_action_date.raw_value).format('MMMM Do')"/>
</div>
</div>
<div class="oe_kanban_bottom_right">
<div class="o_kanban_inline_block">
<field name="activity_ids" widget="kanban_activity" />
</div>
<img t-att-src="kanban_image('res.users', 'image_small', record.owner_user_id.raw_value)" t-att-title="record.owner_user_id.value" width="27" height="27" class="oe_kanban_avatar"/>
</div>
</div>
</div>
<div class="oe_clear"></div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="hr_equipment_view_tree" model="ir.ui.view">
<field name="name">equipment.tree</field>
<field name="model">maintenance.equipment</field>
<field name="arch" type="xml">
<tree string="Assign To User" decoration-bf="message_needaction==True">
<field name="message_needaction" invisible="1"/>
<field name="name"/>
<!-- <field name="active" invisible="1"/> -->
<field name="owner_user_id" string="Owner"/>
<field name="assign_date" groups="base.group_no_one"/>
<field name="serial_no"/>
<field name="technician_user_id"/>
<field name="category_id"/>
<field name="partner_id" invisible="1"/>
</tree>
</field>
</record>
<record id="hr_equipment_view_search" model="ir.ui.view">
<field name="name">equipment.search</field>
<field name="model">maintenance.equipment</field>
<field name="arch" type="xml">
<search string="Search">
<field name="name" filter_domain="['|','|','|',('name','ilike',self),('model','ilike',self),('serial_no','ilike',self),('partner_ref', 'ilike', self)]"/>
<field name="category_id"/>
<field name="owner_user_id"/>
<filter string="Under Maintenance" domain="[('maintenance_open_count', '&gt;', 0)]"/>
<separator/>
<filter string="Assigned" name="assigned" domain="[('owner_user_id', '!=', False)]"/>
<filter string="Available" name="available" domain="[('owner_user_id', '=', False)]"/>
<separator/>
<filter string="My Equipments" name="my" domain="[('owner_user_id', '=', uid)]"/>
<separator/>
<filter string="My Activities" name="activities_my"
domain="[('activity_ids.user_id', '=', uid)]"/>
<separator/>
<filter string="Late Activities" name="activities_overdue"
domain="[('activity_ids.date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
<filter string="Today Activities" name="activities_today"
domain="[('activity_ids.date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter string="Future Activities" name="activities_upcoming_all"
domain="[('activity_ids.date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))
]"/>
<separator/>
<filter string="Unread Messages" name="message_needaction" domain="[('message_needaction','=',True)]"/>
<!-- <filter string="Archived" name="inactive" domain="[('active','=',False)]"/> -->
<group expand='0' string='Group by...'>
<filter string='Technicians' domain="[]" context="{'group_by': 'technician_user_id'}"/>
<filter string='Category' domain="[]" context="{'group_by': 'category_id'}"/>
<filter string='Owner' domain="[]" context="{'group_by': 'owner_user_id'}"/>
<filter string='Vendor' domain="[]" context="{'group_by': 'partner_id'}"/>
</group>
</search>
</field>
</record>
<record id="hr_equipment_action" model="ir.actions.act_window">
<field name="name">Equipments</field>
<field name="res_model">maintenance.equipment</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_id" ref="hr_equipment_view_kanban"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a new equipment.
</p><p>
This application helps you to track equipments used by employees.
Create some laptop, printer or phone and link each equipment to
an employee or department. You will manage allocations, issues
and maintenance of equipment.
</p>
</field>
</record>
<!-- equiment : actions -->
<record id="hr_equipment_action_from_category_form" model="ir.actions.act_window">
<field name="name">Equipments</field>
<field name="res_model">maintenance.equipment</field>
<field name="view_mode">kanban,tree,form</field>
<field name="search_view_id" ref="hr_equipment_view_search"/>
<field name="view_id" ref="hr_equipment_view_kanban"/>
<field name="context">{
'search_default_category_id': [active_id],
'default_category_id': active_id,
}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a new Engine.
</p><p>
This application helps you to track equipments used by employees.
Create some laptop, printer or phone and link each equipment to an employee or department.
You will manage allocations, issues and maintenance of equipment.
</p>
</field>
</record>
<!-- equipment.category : views -->
<record id="hr_equipment_category_view_form" model="ir.ui.view">
<field name="name">equipment.category.form</field>
<field name="model">maintenance.equipment.category</field>
<field name="arch" type="xml">
<form string="Equipment Categories">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="%(hr_equipment_action_from_category_form)d"
class="oe_stat_button"
icon="fa-laptop"
type="action">
<field string="Equipments" name="equipment_count" widget="statinfo"/>
</button>
<button name="%(hr_equipment_request_action_link)d"
type="action"
class="oe_stat_button"
icon="fa-ticket">
<field string="Maintenance" name="maintenance_count" widget="statinfo"/>
</button>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Category Name"/>
<h1>
<field name="name"/>
</h1>
</div>
<group>
<group col="4">
<field name="technician_user_id"/>
</group>
<group name="group_alias" attrs="{'invisible': [('alias_domain', '=', False)]}" groups="base.group_no_one">
<label for="alias_name" string="Email Alias"/>
<div name="alias_def">
<field name="alias_id" class="oe_read_only oe_inline" string="Email Alias" required="0"/>
<div class="oe_edit_only oe_inline" name="edit_alias" style="display: inline;">
<field name="alias_name" class="oe_inline"/>@<field name="alias_domain" class="oe_inline" readonly="1"/>
</div>
</div>
</group>
</group>
<field name="note" nolabel="1"/>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record id="hr_equipment_category_view_tree" model="ir.ui.view">
<field name="name">equipment.category.tree</field>
<field name="model">maintenance.equipment.category</field>
<field name="arch" type="xml">
<tree string="Assign To User">
<field name="name" string="Name"/>
<field name="technician_user_id"/>
</tree>
</field>
</record>
<record id="hr_equipment_category_view_search" model="ir.ui.view">
<field name="name">equipment.category.search</field>
<field name="model">maintenance.equipment.category</field>
<field name="arch" type="xml">
<search string="Search">
<field name="name" string="Category Name" filter_domain="[('name','ilike',self)]"/>
<group expand='0' string='Group by...'>
<filter string='Responsible' domain="[]" context="{'group_by' : 'technician_user_id'}"/>
</group>
</search>
</field>
</record>
<record id="view_maintenance_equipment_category_kanban" model="ir.ui.view">
<field name="name">maintenance.equipment.category.kanban</field>
<field name="model">maintenance.equipment.category</field>
<field name="arch" type="xml">
<kanban>
<field name="name"/>
<field name="technician_user_id"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div class="mb4">
<strong><field name="name"/></strong>
<img t-att-src="kanban_image('res.users', 'image_small', record.technician_user_id.raw_value)" t-att-title="record.technician_user_id.value" width="24" height="24" class="oe_kanban_avatar pull-right"/>
</div>
<div class="row mt4">
<div class="col-xs-6">
<span class="badge">
<strong>Equipments:</strong> <field name="equipment_count"/>
</span>
</div>
<div class="col-xs-6 text-right">
<span class="badge">
<strong>Maintenance:</strong> <field name="maintenance_count"/>
</span>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- equipment.category : actions -->
<record id="hr_equipment_category_action" model="ir.actions.act_window">
<field name="name">Equipment Categories</field>
<field name="res_model">maintenance.equipment.category</field>
<field name="view_mode">tree,kanban,form</field>
<field name="view_id" ref="hr_equipment_category_view_tree"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a new equipment category.
</p>
</field>
</record>
<!-- equipment.stage : views -->
<record id="hr_equipment_stage_view_search" model="ir.ui.view">
<field name="name">equipment.stage.search</field>
<field name="model">maintenance.stage</field>
<field name="arch" type="xml">
<search string="Maintenance Request Stages">
<field name="name" string="Maintenance Request Stages"/>
</search>
</field>
</record>
<record id="hr_equipment_stage_view_tree" model="ir.ui.view">
<field name="name">equipment.stage.tree</field>
<field name="model">maintenance.stage</field>
<field name="arch" type="xml">
<tree string="Maintenance Request Stage" editable="top">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="fold"/>
<field name="done"/>
</tree>
</field>
</record>
<record id="hr_equipment_stage_view_kanban" model="ir.ui.view">
<field name="name">equipment.stage.kanban</field>
<field name="model">maintenance.stage</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div>
<strong><field name="name"/></strong>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- equipment.stages : actions -->
<record id="hr_equipment_stage_action" model="ir.actions.act_window">
<field name="name">Stages</field>
<field name="res_model">maintenance.stage</field>
<field name="view_mode">tree,kanban,form</field>
<field name="view_type">form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a stage in the maintenance request.
</p>
</field>
</record>
<!-- maitenance.team: views -->
<record id="maintenance_team_view_form" model="ir.ui.view">
<field name="name">maintenance.team.form</field>
<field name="model">maintenance.team</field>
<field name="arch" type="xml">
<form string="Maintenance Team">
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Team Name"/>
<h1>
<field name="name"/>
</h1>
</div>
<group>
<group>
<field name="member_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="maintenance_team_view_tree" model="ir.ui.view">
<field name="name">maintenance.team.tree</field>
<field name="model">maintenance.team</field>
<field name="arch" type="xml">
<tree string="Maintenance Team">
<field name="name"/>
</tree>
</field>
</record>
<record id="maintenance_team_view_kanban" model="ir.ui.view">
<field name="name">maintenance.team.kanban</field>
<field name="model">maintenance.team</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div>
<strong><field name="name"/></strong>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="maintenance_team_kanban" model="ir.ui.view">
<field name="name">maintenance.team.kanban</field>
<field name="model">maintenance.team</field>
<field name="arch" type="xml">
<kanban class="oe_background_grey o_kanban_dashboard o_maintenance_team_kanban" create="0">
<field name="name"/>
<field name="color"/>
<field name="todo_request_ids"/>
<field name="todo_request_count"/>
<field name="todo_request_count_date"/>
<field name="todo_request_count_high_priority"/>
<field name="todo_request_count_block"/>
<field name="todo_request_count_unscheduled"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="#{kanban_color(record.color.raw_value)}">
<div t-attf-class="o_kanban_card_header">
<div class="o_kanban_card_header_title">
<div class="o_primary">
<a name="%(hr_equipment_todo_request_action_from_dashboard)d" type="action">
<field name="name"/>
</a></div>
</div>
<div class="o_kanban_manage_button_section">
<a class="o_kanban_manage_toggle_button" href="#"><i class="fa fa-ellipsis-v" /></a>
</div>
</div>
<div class="container o_kanban_card_content">
<div class="row">
<div class="col-xs-6 o_kanban_primary_left">
<button class="btn btn-primary" name="%(hr_equipment_todo_request_action_from_dashboard)d" type="action" context="{'search_default_todo': 1}">
<t t-esc="record.todo_request_count.value"/> To Do
</button>
</div>
<div class="col-xs-6 o_kanban_primary_right">
<div class="row">
<div class="col-xs-9">
<a name="%(hr_equipment_request_action_cal)d" type="action">
Scheduled
</a>
</div>
<div class="col-xs-3">
<t t-esc="record.todo_request_count_date.value"/>
</div>
<div class="col-xs-9">
<a name="%(hr_equipment_todo_request_action_from_dashboard)d" type="action" context="{'search_default_top_priority': 1}">
Top Priorities
</a>
</div>
<div class="col-xs-3">
<t t-esc="record.todo_request_count_high_priority.value"/>
</div>
<div class="col-xs-9">
<a name="%(hr_equipment_todo_request_action_from_dashboard)d" type="action" context="{'search_default_kanban_state_block': 1}">
Blocked
</a>
</div>
<div class="col-xs-3">
<t t-esc="record.todo_request_count_block.value"/>
</div>
<div class="col-xs-9">
<a name="%(hr_equipment_todo_request_action_from_dashboard)d" type="action" context="{'search_default_unscheduled': 1}">
Unscheduled
</a>
</div>
<div class="col-xs-3">
<t t-esc="record.todo_request_count_unscheduled.value"/>
</div>
</div>
</div>
</div>
</div><div class="container o_kanban_card_manage_pane">
<div class="row">
<div class="col-xs-6 o_kanban_card_manage_section o_kanban_manage_view">
<div class="o_kanban_card_manage_title">
<span>View</span>
</div>
<div>
<a name="%(hr_equipment_todo_request_action_from_dashboard)d" type="action">
All
</a>
</div>
<div>
<a name="%(hr_equipment_todo_request_action_from_dashboard)d" type="action" context="{'search_default_todo': 1}">
To Do
</a>
</div>
<div>
<a name="%(hr_equipment_todo_request_action_from_dashboard)d" type="action" context="{'search_default_progress': 1}">
In Progress
</a>
</div>
<div>
<a name="%(hr_equipment_todo_request_action_from_dashboard)d" type="action" context="{'search_default_done': 1}">
Done
</a>
</div>
</div>
<div class="col-xs-6 o_kanban_card_manage_section o_kanban_manage_new">
<div class="o_kanban_card_manage_title">
<span>Reporting</span>
</div>
<div>
<a name="%(maintenance_request_action_reports)d" type="action" context="{'search_default_maintenance_team_id': active_id}">
Maintenance Requests
</a>
</div>
</div>
</div>
<div t-if="widget.editable" class="o_kanban_card_manage_settings row">
<div class="col-xs-8">
<ul class="oe_kanban_colorpicker" data-field="color"/>
</div>
<div class="col-xs-4 text-right">
<a type="edit">Settings</a>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- equipment.team : actions -->
<record id="maintenance_team_action_settings" model="ir.actions.act_window">
<field name="name">Teams</field>
<field name="res_model">maintenance.team</field>
<field name="view_type">form</field>
<field name="view_mode">tree,kanban,form</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('maintenance_team_view_tree')}),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('maintenance_team_view_kanban')})]"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a team in the maintenance request.
</p>
</field>
</record>
<record id="maintenance_dashboard_action" model="ir.actions.act_window">
<field name="name">Maintenance Teams</field>
<field name="res_model">maintenance.team</field>
<field name="view_mode">kanban,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="maintenance_team_kanban"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a stage in the maintenance request.
</p>
</field>
</record>
<!-- Menu items hierachy -->
<menuitem
id="menu_maintenance_title"
name="Maintenance"
web_icon="maintenance,static/description/icon.png"
sequence="110"/>
<menuitem
id="menu_m_dashboard"
name="Dashboard"
parent="menu_maintenance_title"
groups="group_equipment_manager,base.group_user"
action="maintenance_dashboard_action"
sequence="0"/>
<menuitem
id="menu_m_request"
name="Maintenance"
parent="menu_maintenance_title"
groups="group_equipment_manager,base.group_user"
sequence="1"/>
<menuitem
id="menu_m_request_form"
name="Maintenance Requests"
parent="menu_m_request"
action="hr_equipment_request_action"
groups="group_equipment_manager,base.group_user"
sequence="1"/>
<menuitem
id="menu_m_request_calendar"
name="Maintenance Calendar"
parent="menu_m_request"
action="hr_equipment_request_action_cal"
groups="group_equipment_manager,base.group_user"
sequence="2"/>
<menuitem
id="menu_equipment_form"
name="Equipments"
parent="menu_maintenance_title"
action="hr_equipment_action"
groups="group_equipment_manager,base.group_user"
sequence="2"/>
<menuitem
id="menu_m_reports"
name="Reporting"
parent="menu_maintenance_title"
groups="group_equipment_manager,base.group_user"
sequence="3"/>
<menuitem
id="menu_m_reports_oee"
name="Overall Equipment Effectiveness (OEE)"
parent="menu_m_reports"
groups="group_equipment_manager,base.group_user"
sequence="1"/>
<menuitem
id="menu_m_reports_losses"
name="Losses Analysis"
parent="menu_m_reports"
groups="group_equipment_manager,base.group_user"
sequence="2"/>
<menuitem
id="maintenance_reporting"
name="Reporting"
parent="menu_maintenance_title"
sequence="20"/>
<menuitem
id="maintenance_request_reporting"
action="maintenance_request_action_reports"
parent="maintenance_reporting"/>
<menuitem
id="menu_maintenance_configuration"
name="Configuration"
parent="menu_maintenance_title"
groups="group_equipment_manager"
sequence="100"/>
<menuitem
id="menu_maintenance_teams"
name="Maintenance Teams"
parent="menu_maintenance_configuration"
action="maintenance_team_action_settings"
groups="group_equipment_manager"
sequence="1"/>
<menuitem
id="menu_maintenance_cat"
name="Equipment Categories"
parent="menu_maintenance_configuration"
action="hr_equipment_category_action"
sequence="2"/>
<menuitem
id="menu_maintenance_stage_configuration"
name="Maintenance Stages"
parent="menu_maintenance_configuration"
action="hr_equipment_stage_action"
groups="base.group_no_one"
sequence="3" />
</flectra>