149 lines
5.6 KiB
XML
149 lines
5.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!--
|
|
Copyright 2016 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/>.
|
|
-->
|
|
<openerp>
|
|
<data>
|
|
|
|
<!-- Form -->
|
|
<record model="ir.ui.view" id="session_smart">
|
|
<field name="name">Add sessions management into smart button</field>
|
|
<field name="model">golem.activity</field>
|
|
<field name="inherit_id" ref="golem_activity.view_form" />
|
|
<field name="arch" type="xml">
|
|
<div name="buttons" position="inside">
|
|
<button class="oe_inline oe_stat_button" type="object"
|
|
name="button_session" icon="fa-list">
|
|
<field string="Sessions" name="session_count"
|
|
widget="statinfo" />
|
|
</button>
|
|
</div>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="view_form" model="ir.ui.view">
|
|
<field name="name">GOLEM Activity Sessions Form</field>
|
|
<field name="model">golem.activity.session</field>
|
|
<field name="arch" type="xml">
|
|
<form>
|
|
<sheet>
|
|
<group string="Activity Session">
|
|
<group>
|
|
<field name="activity_id" />
|
|
<field name="animator_id" />
|
|
<field name="places" />
|
|
<field name="places_min" />
|
|
<field name="is_overbooked" />
|
|
<field name="places_overbooked"
|
|
attrs="{'invisible': [('is_overbooked', '=', False)]}" />
|
|
</group>
|
|
<group>
|
|
<field name="is_recurrent" />
|
|
<field name="weekday"
|
|
attrs="{'invisible': [('is_recurrent', '=', False)]}" />
|
|
<field name="hour_start" widget="float_time"
|
|
attrs="{'invisible': [('is_recurrent', '=', False)]}" />
|
|
<field name="hour_end" widget="float_time"
|
|
attrs="{'invisible': [('is_recurrent', '=', False)]}" />
|
|
<field name="date_start"
|
|
attrs="{'invisible': [('is_recurrent', '=', True)]}" />
|
|
<field name="date_end"
|
|
attrs="{'invisible': [('is_recurrent', '=', True)]}" />
|
|
</group>
|
|
</group>
|
|
<notebook>
|
|
<page string="Members">
|
|
<group>
|
|
<field name="places_remain" readonly="True" />
|
|
<field name="member_ids" />
|
|
</group>
|
|
</page>
|
|
<page string="Note">
|
|
<field name="note" />
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Tree -->
|
|
<record id="session_tree" model="ir.ui.view">
|
|
<field name="name">Session list</field>
|
|
<field name="model">golem.activity.session</field>
|
|
<field name="arch" type="xml">
|
|
<tree colors="darkgrey: places_used < places_min;
|
|
red: places_remain == 0;
|
|
orange: places_remain <= 4;">
|
|
<field name="is_recurrent" invisible="True" />
|
|
<field name="activity_id" />
|
|
<field name="animator_id" />
|
|
<field name="weekday" string="Day"
|
|
attrs="{'invisible': [('is_recurrent', '=', False)]}" />
|
|
<field name="hour_start" string="Hour"
|
|
attrs="{'invisible': [('is_recurrent', '=', False)]}" />
|
|
<field name="date_start" string="Date"
|
|
attrs="{'invisible': [('is_recurrent', '=', True)]}" />
|
|
<field name="places" />
|
|
<field name="places_min" string="Min." />
|
|
<field name="places_remain" string="Remain" />
|
|
<field name="places_used" invisible="True" />
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Calendars -->
|
|
<record id="calendar" model="ir.ui.view">
|
|
<field name="name">Activity sessions calendar view</field>
|
|
<field name="model">golem.activity.session</field>
|
|
<field name="arch" type="xml">
|
|
<calendar date_start="date_start" date_end="date_end"
|
|
color="categ_id" display="[name]">
|
|
<field name="name" />
|
|
</calendar>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Searches -->
|
|
<record id="searches" model="ir.ui.view">
|
|
<field name="name">GOLEM Activity Sessions Searches</field>
|
|
<field name="model">golem.activity.session</field>
|
|
<field name="arch" type="xml">
|
|
<search>
|
|
<field name="activity_id" widget="many2one" />
|
|
<field name="animator_id" widget="many2one" />
|
|
<group string="Group By">
|
|
<filter name="group_weekday" string="By weekday"
|
|
context="{'group_by': 'weekday'}" />
|
|
<filter name="group_animator" string="By animator"
|
|
context="{'group_by': 'animator_id'}" />
|
|
</group>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Actions -->
|
|
<act_window id="session_action_list" name="GOLEM Activities Sessions List"
|
|
res_model="golem.activity.session" view_mode="tree,form,calendar" />
|
|
<!-- Menus -->
|
|
<menuitem id="session_menu_list" name="Activities sessions"
|
|
parent="golem_activity.activity_menu" action="session_action_list"
|
|
sequence="10" />
|
|
|
|
|
|
</data>
|
|
</openerp>
|