2018-02-07 01:44:48 +01:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<!--
|
2018-02-18 07:27:32 +01:00
|
|
|
Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
|
2018-02-08 00:58:23 +01:00
|
|
|
Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
|
2018-02-07 01:44:48 +01:00
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
-->
|
|
|
|
<odoo>
|
|
|
|
<data>
|
2018-02-18 12:25:11 +01:00
|
|
|
|
|
|
|
<!-- Calendars -->
|
|
|
|
<record model="ir.ui.view" id="golem_resource_reservation_view_calendar">
|
|
|
|
<field name="name">GOLEM Resource Reservation Calendar</field>
|
|
|
|
<field name="model">golem.resource.reservation</field>
|
2018-02-07 01:44:48 +01:00
|
|
|
<field name="arch" type="xml">
|
2018-02-18 12:25:11 +01:00
|
|
|
<calendar date_start="date_start" date_stop="date_stop" color="resource_id">
|
|
|
|
<field name="resource_id" />
|
|
|
|
<field name="user_id" />
|
|
|
|
<field name="partner_id" />
|
2018-02-07 01:44:48 +01:00
|
|
|
</calendar>
|
|
|
|
</field>
|
|
|
|
</record>
|
2018-02-10 00:05:36 +01:00
|
|
|
|
2018-02-18 12:25:11 +01:00
|
|
|
<!-- Trees -->
|
|
|
|
<record model="ir.ui.view" id="golem_resource_reservation_view_tree">
|
|
|
|
<field name="name">GOLEM Resource Reservation Tree</field>
|
|
|
|
<field name="model">golem.resource.reservation</field>
|
2018-02-07 01:44:48 +01:00
|
|
|
<field name="arch" type="xml">
|
2018-02-18 12:25:11 +01:00
|
|
|
<tree>
|
|
|
|
<field name="resource_id" />
|
2018-02-18 16:55:24 +01:00
|
|
|
<field name="date" />
|
|
|
|
<field name="hour_start" widget="float_time" />
|
|
|
|
<field name="hour_stop" widget="float_time" />
|
2018-02-18 12:25:11 +01:00
|
|
|
<field name="partner_id" />
|
2018-02-18 16:41:50 +01:00
|
|
|
<field name="state" />
|
2018-02-07 01:44:48 +01:00
|
|
|
</tree>
|
|
|
|
</field>
|
|
|
|
</record>
|
2018-02-10 00:05:36 +01:00
|
|
|
|
2018-02-18 12:25:11 +01:00
|
|
|
<!-- Forms -->
|
|
|
|
<record model="ir.ui.view" id="golem_resource_reservation_view_form">
|
|
|
|
<field name="name">GOLEM Resource Reservation Form</field>
|
|
|
|
<field name="model">golem.resource.reservation</field>
|
2018-02-07 01:44:48 +01:00
|
|
|
<field name="arch" type="xml">
|
2018-02-18 12:25:11 +01:00
|
|
|
<form>
|
2018-02-07 01:44:48 +01:00
|
|
|
<header>
|
2018-02-18 16:41:50 +01:00
|
|
|
<button name="state_confirm" type="object" string="Confirm" class="oe_highlight"
|
|
|
|
attrs="{'invisible': ['|', ('state', 'not in', 'draft'), ('id', '=', False)]}" />
|
|
|
|
<button name="state_canceled" type="object"
|
|
|
|
string="Cancel" states="confirmed,validated" />
|
|
|
|
<button name="state_draft" type="object" string="Set to draft"
|
|
|
|
states="canceled,confirmed,validated,rejected" />
|
|
|
|
<button name="state_validated" type="object" string="Validate"
|
|
|
|
states="confirmed" class="oe_highlight"
|
|
|
|
groups="golem_base.group_golem_manager" />
|
|
|
|
<button name="state_rejected" type="object" string="Reject"
|
|
|
|
states="confirmed" class="oe_highlight"
|
|
|
|
groups="golem_base.group_golem_manager" />
|
|
|
|
<field name="state" widget="statusbar" />
|
2018-02-07 01:44:48 +01:00
|
|
|
</header>
|
|
|
|
<sheet>
|
2018-02-18 17:17:32 +01:00
|
|
|
<group>
|
|
|
|
<group string="Resource">
|
2018-02-18 16:41:50 +01:00
|
|
|
<field name="id" invisible="1" />
|
|
|
|
<field name="resource_id" options="{'no_create': True}" />
|
2018-03-10 07:53:04 +01:00
|
|
|
<field name="resource_avaibility_24_7" readonly="1" />
|
2018-03-10 08:33:43 +01:00
|
|
|
<field name="resource_avaibility_start" readonly="1" />
|
|
|
|
<field name="resource_avaibility_stop" readonly="1" />
|
2018-03-10 07:53:04 +01:00
|
|
|
<field name="resource_timetable_ids" readonly="1"
|
|
|
|
attrs="{'invisible': [('resource_avaibility_24_7', '=', True)]}" />
|
2018-02-18 16:41:50 +01:00
|
|
|
</group>
|
2018-02-18 17:17:32 +01:00
|
|
|
<group string="Reservation">
|
|
|
|
<group>
|
|
|
|
<field name="date" />
|
|
|
|
<field name="hour_start" widget="float_time" />
|
|
|
|
<field name="hour_stop" widget="float_time" />
|
|
|
|
<field name="user_id" options="{'no_create': True}" />
|
|
|
|
<field name="partner_id" />
|
2018-03-09 08:44:17 +01:00
|
|
|
<field name="note"
|
|
|
|
placeholder="Notes, optional subject for the reservation, reason" />
|
2018-02-18 17:17:32 +01:00
|
|
|
<field name="rejection_reason"
|
|
|
|
attrs="{'invisible': [('state', '!=', 'rejected')]}"/>
|
|
|
|
</group>
|
2018-02-18 16:41:50 +01:00
|
|
|
</group>
|
|
|
|
</group>
|
2018-02-18 12:25:11 +01:00
|
|
|
</sheet>
|
2018-02-18 17:30:11 +01:00
|
|
|
<div class="oe_chatter">
|
|
|
|
<field name="message_follower_ids" widget="mail_followers" />
|
|
|
|
<field name="message_ids" widget="mail_thread" />
|
|
|
|
</div>
|
2018-02-07 01:44:48 +01:00
|
|
|
</form>
|
|
|
|
</field>
|
|
|
|
</record>
|
2018-02-13 15:04:55 +01:00
|
|
|
|
2018-02-18 12:25:11 +01:00
|
|
|
<!-- Searches -->
|
|
|
|
<record model="ir.ui.view" id="golem_resource_reservation_view_search">
|
|
|
|
<field name="name">GOLEM Resource Reservation Search</field>
|
|
|
|
<field name="model">golem.resource.reservation</field>
|
2018-02-13 15:04:55 +01:00
|
|
|
<field name="arch" type="xml">
|
2018-02-18 12:25:11 +01:00
|
|
|
<search>
|
|
|
|
<field name="date_start" />
|
|
|
|
<field name="date_stop" />
|
|
|
|
<field name="resource_id" />
|
|
|
|
<field name="user_id" />
|
|
|
|
<field name="partner_id" />
|
2018-02-18 16:41:50 +01:00
|
|
|
<field name="state" />
|
2018-02-18 12:25:11 +01:00
|
|
|
<filter name="to_validate" string="Reservation to Validate"
|
2018-02-18 16:41:50 +01:00
|
|
|
domain="[('state', '=', 'confirmed')]" />
|
2018-02-18 16:55:24 +01:00
|
|
|
<filter name="group_state" string="State"
|
|
|
|
context="{'group_by': 'state'}" />
|
|
|
|
<filter name="group_resource" string="Resource"
|
|
|
|
context="{'group_by': 'resource_id'}" />
|
|
|
|
<filter name="group_partner_id" string="Partner"
|
|
|
|
context="{'group_by': 'partner_id'}" />
|
|
|
|
<filter name="group_user" string="User"
|
|
|
|
context="{'group_by': 'user_id'}" />
|
|
|
|
<filter name="group_date_month" string="Month"
|
|
|
|
context="{'group_by': 'date:month'}" />
|
|
|
|
<filter name="group_date_week" string="Week"
|
|
|
|
context="{'group_by': 'date:week'}" />
|
|
|
|
<filter name="group_date_day" string="Day"
|
|
|
|
context="{'group_by': 'date:day'}" />
|
2018-02-13 15:04:55 +01:00
|
|
|
</search>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
2018-02-18 12:25:11 +01:00
|
|
|
<!-- Actions -->
|
|
|
|
<act_window id="golem_resource_reservation_action" name="Reservations"
|
|
|
|
res_model="golem.resource.reservation" view_mode="tree,form,calendar" />
|
|
|
|
|
|
|
|
<!-- Menus -->
|
|
|
|
<menuitem id="golem_resource_reservation_menu" name="Reservations"
|
|
|
|
parent="golem_resource_menu" action="golem_resource_reservation_action"
|
|
|
|
sequence="20" />
|
2018-02-14 13:44:37 +01:00
|
|
|
|
2018-02-07 01:44:48 +01:00
|
|
|
</data>
|
|
|
|
</odoo>
|