Coworking/views/event_views.xml

97 lines
3.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Form -->
<record id="view_form_event" model="ir.ui.view">
<field name="name">Event Form</field>
<field name="model">coworking.event</field>
<field name="arch" type="xml">
<form string="event">
<header>
<field name="statut" widget="statusbar" clickable="1" />
</header>
<sheet>
<group name="group_top">
<group name="group_left">
<field name="title" />
<field name="manager_id" />
<field name="date_start" />
<field name="starts_this_week" attrs="{'invisible': [('date_start', '=', True)]}" />
<field name="date_end" />
<field name="duration" widget="float_time" />
<field name="description" />
<field name="participants_ids" widget="many2many_tags"
options="{'no_create': true}" />
</group>
</group>
</sheet>
</form>
</field>
</record>
<!-- Tree -->
<record id="view_tree_coworker" model="ir.ui.view">
<field name="name">event Tree</field>
<field name="model">coworking.event</field>
<field name="arch" type="xml">
<tree default_order="date_start asc">
<field name="title" />
<field name="manager_id" />
<field name="date_start" />
<field name="participants_count" />
<field name="statut" />
</tree>
</field>
</record>
<!-- Search -->
<record id="view_search_event" model="ir.ui.view">
<field name="name">Event Search</field>
<field name="model">coworking.event</field>
<field name="arch" type="xml">
<search>
<field name="title" />
<field name="manager_id" />
<filter name="status_confirmed" string="Confirmed"
domain="[('statut','=','confirmed')]" />
<filter name="status_draft" string="Draft"
domain="[('statut','=','draft')]" />
<filter name="canceled" string="Canceled"
domain="[('statut','=','canceled')]" />
<separator />
<filter name="this_week" string="Starts this week"
domain="[('starts_this_week','=', True)]" />
<filter name="this_30_month" string="Starts 30 month"
domain="[('date_start','&lt;=', datetime.datetime.combine(context_today() + datetime.timedelta(days=30), datetime.time(23,59,59))),
('date_start','&gt;=', datetime.datetime.combine(context_today(), datetime.time(0,0,0)))]" />
<filter name="group_status" string="Group status"
context="{'group_by': 'statut'}" />
<filter name="group_manager_id" string="Group manager"
context="{'group_by': 'manager_id'}" />
<filter name="group_years_start" string="Group years start"
context="{'group_by': 'date_start:year'}" />
<filter name="group_month" string="Group month"
context="{'group_by': 'date_start:month'}" />
</search>
</field>
</record>
<!-- Calendar -->
<record id="view_calendar_event" model="ir.ui.view">
<field name="name">Event Calendar</field>
<field name="model">coworking.event</field>
<field name="arch" type="xml">
<calendar date_start="date_start" date_stop="date_end"
display="[title]" >
<field name="title" />
</calendar>
</field>
</record>
</odoo>