GOLEM/golem_ressources/views/golem_resources_views.xml

128 lines
5.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Fabien Bourgeois <fabien@yaltik.com>
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>
<!-- Remplissage du modele golem.weekday par les jours de la semaine -->
<record model="golem.weekday" id="1">
<field name="name">Sunday</field>
</record>
<record model="golem.weekday" id="2">
<field name="name">Monday</field>
</record>
<record model="golem.weekday" id="3">
<field name="name">Tuesday</field>
</record>
<record model="golem.weekday" id="4">
<field name="name">wednesday</field>
</record>
<record model="golem.weekday" id="5">
<field name="name">Thursday</field>
</record>
<record model="golem.weekday" id="6">
<field name="name">Friday</field>
</record>
<record model="golem.weekday" id="7">
<field name="name">Saturday</field>
</record>
<!--formulaire de recherche et filtrage du modèle golem.resources-->
<record model="ir.ui.view" id="resource_search_view">
<field name="name">resource.search</field>
<field name="model">golem.resources</field>
<field name="arch" type="xml">
<search string="Resource Search">
<field name="name"/>
<field name="resource_type"/>
<field name="resource_responsible"/>
<field name="article_link"/>
</search>
</field>
</record>
<!--liste d'affichage du modèle golem.resources-->
<record model="ir.ui.view" id="resource_tree_view">
<field name="name">resource.tree</field>
<field name="model">golem.resources</field>
<field name="arch" type="xml">
<tree string="Resource Form">
<field name="name"/>
<field name="resource_type"/>
<field name="resource_responsible"/>
<field name="article_link"/>
<field name="start_of_availability_date"/>
<field name="end_of_availability_date"/>
<field name="weekdays_of_availibility" widget="many2many_tags" options="{'no_create_edit':'1'}"/>
</tree>
</field>
</record>
<!--formulaire du modèle golem.resources-->
<record model="ir.ui.view" id="resource_form_view">
<field name="name">resource.form</field>
<field name="model">golem.resources</field>
<field name="arch" type="xml">
<form string="Resource Form">
<sheet>
<div class="oe_button_box" name="button_box" groups="base.group_user">
<button class="oe_stat_button" icon="fa-archive" name="active_change" type="object"
align="right">
<field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>
</button>
</div>
<group colspan="2">
<group colspan="4" col="4">
<field name="name"/>
<field name="resource_type"/>
<field name="resource_responsible"/>
<field name="article_link"/>
</group>
<group colspan="3">
<separator string="Availibility configuration" colspan="3"/>
<field name="start_of_availability_date"/>
<field name="end_of_availability_date"/>
<field name="weekdays_of_availibility" widget="many2many_tags" options="{'no_create_edit':'1'}"/>
<field name="timetable">
<tree editable="bottom" context="{'default_resource_id': active_id}">
<field name="resource_id" invisible="1" />
<field name="name" />
<field name="start_time" />
<field name="end_time" />
</tree>
</field>
</group>
</group>
</sheet>
</form>
</field>
</record>
<!--action du sous menu Resources-->
<record model="ir.actions.act_window" id="action_resources">
<field name="name">Resources</field>
<field name="res_model">golem.resources</field>
<field name="view_mode">tree,form,search</field>
</record>
<!--menu principale et sous menu-->
<menuitem id="resources_menu" name="Resources" sequence="10"/>
<menuitem id="resources_sub_menu" name="Resources" parent="resources_menu"
action="action_resources"/>
</data>
</odoo>