Newer
Older
<?xml version="1.0"?>
<!-- Copyright 2019 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<!-- ******************************
*** Inherited Views
****************************** -->
<!-- Agenda Tree View -->
<record id="view_calendar_cooperative_tree_inherited" model="ir.ui.view">
<field name="name">calendar.event.cgscop.tree</field>
<field name="model">calendar.event</field>
<field name="inherit_id" ref="calendar.view_calendar_event_tree"/>
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="default_order">start</attribute>
</tree>
<attribute name="invisible">True</attribute>
</field>
<field name="location" position="attributes">
<attribute name="invisible">True</attribute>

Benjamin - Le Filament
a validé
<field name="ur_regional_convention_nb" invisible="1"/>
<field name="ur_financial_system_nb" invisible="1"/>
<field name="coop_id"/>
<field name="project_id"/>
<field name="type"/>

Benjamin - Le Filament
a validé
<field name="ur_financial_system_id" options="{'no_open': True, 'no_create': True}" attrs="{'required':[('ur_financial_system_nb', '>', 0)], 'invisible':[('ur_financial_system_nb', '<', 1)]}"/>
<field name="ur_regional_convention_id" options="{'no_open': True, 'no_create': True}" attrs="{'required':[('ur_regional_convention_nb', '>', 0)], 'invisible':[('ur_regional_convention_nb', '<', 1)]}"/>
<field name="is_transfered" />
</field>
</field>
</record>
<!-- Agenda Form View -->
<record id="view_calendar_cooperative_form_inherited" model="ir.ui.view">
<field name="name">calendar.event.cgscop.form</field>
<field name="model">calendar.event</field>
<field name="inherit_id" ref="calendar.view_calendar_event_form"/>
<field name="arch" type="xml">
<!-- Header -->
<sheet position="before">
<header>

Benjamin - Le Filament
a validé
<button
string="Dupliquer"
type="object"
name="duplicate_entry"
class="oe_highlight"
/>
<button
string="Transformer en ligne de temps"
type="object"
name="create_timesheet"
class="oe_highlight"
attrs="{'invisible':
['|', '|', '|', ('project_id', '=', False), ('coop_id', '=', False), ('is_attendee', '!=', True), ('is_transfered', '=', True)]}"/>
<!-- Boutons -->
<button name="action_open_calendar_event" position="attributes">
</button>
<!-- Titre -->
<div class="oe_title" position="replace">
<div class="oe_button_box" name="button_box" modifiers="{}">
<button name="do_accept" string="Accepter" states="needsAction,tentative,declined" type="object" icon="fa-check">
</button>
<button name="do_decline" string="Refuser" states="needsAction,tentative,accepted" type="object" icon="fa-times-circle"/>
<button name="do_tentative" widget="boolean_button" class="oe_stat_button" states="needsAction,declined,accepted" string="Incertain" type="object" icon="fa-circle">
</button>
</div>
<div class="oe_title" >
<div class="oe_edit_only">
<label for="name"/>
</div>
<h1>
<field name="name" placeholder="e.g. Business Lunch"/>
</h1>
</div>
</div>
<!-- Masque notebook & crée la vue -->
<notebook position="before">
<group name="event_info" col="1">
<field name="state"/>
<field name="is_transfered" widget="toggle_button"/>
<field name="is_attendee" invisible="1"/>
<field name="project_id" options="{'no_open': True, 'no_create': True}"/>
<field name="coop_id" options="{'no_open': True, 'no_create': True}" domain="[('ur_id', '=', ur_id),('is_company', '=', 'True')]"/>
<field name="ur_id" invisible="1"/>
options="{'no_open': True, 'no_create': True}"
context="{'force_email':True}"
domain="[('user_ids', '!=', False), ('ur_id', '=', ur_id)]"
</group>
<group>
<field name="start_date" string="Starting at" attrs="{'required': [('allday','=',True)], 'invisible': [('allday','=',False)], 'readonly': [('id', '!=', False), ('recurrency','=',True)]}" force_save="1"/>
<field name="stop_date" string="Ending at" attrs="{'required': [('allday','=',True)],'invisible': [('allday','=',False)], 'readonly': [('id', '!=', False), ('recurrency','=',True)]}" force_save="1"/>
<field name="start_datetime" string="Starting at" attrs="{'required': [('allday','=',False)], 'invisible': [('allday','=',True)], 'readonly': [('id', '!=', False), ('recurrency','=',True)]}"/>
<field name="stop_datetime" invisible="1"/>
<label for="duration" attrs="{'invisible': [('allday','=',True)]}"/>
<div attrs="{'invisible': [('allday','=',True)]}">
<field name="duration" widget="float_time" string="Duration" class="oe_inline" attrs="{'readonly': [('id', '!=', False), ('recurrency','=',True)]}"/>
<span> hours</span>
</div>
<field name="allday" attrs="{'readonly': [('id', '!=', False), ('recurrency','=',True)]}" force_save="1"/>
<field name="type" attrs="{'required': [('ur_id','=',%(cgscop_partner.riga_14231)d)]}"/>
<field name="format" attrs="{'invisible': [('ur_id','!=',%(cgscop_partner.riga_14231)d)]}"/>

Benjamin - Le Filament
a validé
<field name="ur_financial_system_nb" invisible="1"/>

Benjamin - Le Filament
a validé
<field name="ur_regional_convention_nb" invisible="1"/>
<field name="ur_financial_system_id" options="{'no_open': True, 'no_create': True}" attrs="{'required':[('ur_financial_system_nb', '>', 0)], 'invisible':[('ur_financial_system_id', '=', 0)]}"/>
<field name="ur_regional_convention_id" options="{'no_open': True, 'no_create': True}" attrs="{'required':[('ur_regional_convention_nb', '>', 0)], 'invisible':[('ur_regional_convention_nb', '=', 0)]}"/>
<group string="Description du rendez-vous">
<field name="description"/>
</group>
<group string="Informations complémentaires" name="event_extra_info">

Rémi - Le Filament
a validé
<div>
<group>
<field name="alarm_ids" widget="many2many_tags" options="{'no_open': True, 'no_create': True}" />

Rémi - Le Filament
a validé
<field name="recurrency"/>
</group>
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<div attrs="{'invisible': [('recurrency', '=', False)]}">
<group>
<label for="interval"/>
<div class="o_row">
<field name="interval" attrs="{'required': [('recurrency', '=', True)]}"/>
<field name="rrule_type" attrs="{'required': [('recurrency', '=', True)]}"/>
</div>
<label string="Until" for="end_type"/>
<div class="o_row">
<field name="end_type" attrs="{'required': [('recurrency', '=', True)]}"/>
<field name="count" attrs="{'invisible': [('end_type', '!=', 'count')], 'required': [('recurrency', '=', True)]}"/>
<field name="final_date" attrs="{'invisible': [('end_type', '!=', 'end_date')], 'required': [('end_type', '=', 'end_date'), ('recurrency', '=', True)]}"/>
</div>
</group>
<group attrs="{'invisible': [('rrule_type', '!=', 'weekly')]}" name="weekdays">
<field name="mo"/>
<field name="tu"/>
<field name="we"/>
<field name="th"/>
<field name="fr"/>
<field name="sa"/>
<field name="su"/>
</group>
<group attrs="{'invisible': [('rrule_type', '!=', 'monthly')]}">
<label string="Day of Month" for="month_by"/>
<div class="o_row">
<field name="month_by"/>
<field name="day"
attrs="{'required': [('month_by', '=', 'date'), ('rrule_type', '=', 'monthly')],
'invisible': [('month_by', '!=', 'date')]}"/>
<field name="byday" string="The"
attrs="{'required': [('recurrency', '=', True), ('month_by', '=', 'day'), ('rrule_type', '=', 'monthly')],
'invisible': [('month_by', '!=', 'day')]}"/>
<field name="week_list" nolabel="1"
attrs="{'required': [('recurrency', '=', True), ('month_by', '=', 'day'), ('rrule_type', '=', 'monthly')],
'invisible': [('month_by', '!=', 'day')]}"/>
</div>
</group>
</div>

Rémi - Le Filament
a validé
</div>
<field name="privacy"/>
<field name="show_as"/>
<field name="recurrent_id" invisible="1" />
</notebook>
<notebook position="attributes">
<attribute name="invisible">True</attribute>
</notebook>
</field>
</record>
<!-- Calendar view -->
<record id="view_calendar_cooperative_calendar_inherited" model="ir.ui.view">
<field name="name">calendar.event.cgscop.calendar</field>
<field name="model">calendar.event</field>
<field name="inherit_id" ref="calendar.view_calendar_event_calendar"/>
<field name="arch" type="xml">
<calendar position="attributes">
<attribute name="quick_add">False</attribute>
<attribute name="readonly_form_view_id">cgscop_calendar.view_calendar_cooperative_form_inherited</attribute>
</calendar>
<field name="partner_ids" position="before">
<field name="ur_id" invisible="1"/>

Benjamin - Le Filament
a validé
<field name="coop_id" options="{'no_open': True, 'no_create': True}"/>
<field name="type" options="{'no_open': True, 'no_create': True}"/>
<field name="attendees_initial"/>
</field>
<field name="partner_ids" position="attributes">
<attribute name="domain">[('user_ids', '!=', False), ('ur_id', '=', ur_id)]</attribute>
</field>
</field>
</record>
<!-- Search view -->
<record id="view_calendar_cooperative_search_inherited" model="ir.ui.view">
<field name="name">calendar.event.cgscop.search</field>
<field name="model">calendar.event</field>
<field name="inherit_id" ref="calendar.view_calendar_event_search"/>
<field name="arch" type="xml">
<!-- Masque étiquettes -->
<field name="name" position="after">
<field name="coop_id"/>
</field>
<filter name="mymeetings" position="after">
<separator/>
<filter string="UR" name="ur" domain="[('type', '=', 'ur')]"/>
<filter string="Hors UR" name="not_ur" domain="[('type', '=', 'outside')]"/>
<filter string="Absent" name="absent" domain="[('type', '=', 'absent')]"/>
<separator/>
<filter string="Ce mois-ci" name="this_month" domain="[('start','<=', (context_today()-relativedelta(day=31, months=0)).strftime('%Y-%m-%d')),
('start','>=',(context_today()-relativedelta(day=1,months=0)).strftime('%Y-%m-%d'))]"/>
<filter string="Le mois pécédent" name="last_month" domain="[('start','<=', (context_today()-relativedelta(day=31, months=1)).strftime('%Y-%m-%d')),
('start','>=',(context_today()-relativedelta(day=1,months=1)).strftime('%Y-%m-%d'))]"/>
<filter string="Ce trimestre" name="this_trimester" domain="[
('start','>=',(context_today()-relativedelta(months=3)).strftime('%Y-%m-%d'))]" invisible="1"/>
<filter name="privacy" position="after">
<separator/>
<filter name="start" string="Date de début" context="{'group_by': 'start'}"/>
</filter>
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<!-- ******************************
*** Custom Views
****************************** -->
<!-- Resource view -->
<record id="view_calendar_cooperative_resource" model="ir.ui.view">
<field name="name">calendar.event.cgscop.calendar</field>
<field name="model">calendar.event</field>
<field name="arch" type="xml">
<resource
string="Meetings"
date_start="start"
date_stop="stop"
date_delay="duration"
all_day="allday"
readonly_form_view_id="cgscop_calendar.view_calendar_cooperative_form_inherited"
event_open_popup="true"
event_limit="3"
color="type"
quick_add="False"
resource_field='partner_ids'>
<field name="name" />
<field name="ur_id" invisible="1" />
<field name="coop_id" options="{'no_open': True, 'no_create': True}" />
<field name="type" options="{'no_open': True, 'no_create': True}" />
<field name="partner_id" options="{'no_open': True, 'no_create': True}" invisible="1"/>
<field name="attendees_initial" />
<field name="partner_ids" domain="[('user_ids', '!=', False), ('ur_id', '=', ur_id)]"/>
<field name="is_highlighted" invisible="1" />
</resource>
</field>
</record>
<!-- ******************************
*** Actions
****************************** -->
<!-- Override Calendar Event action -->
<record id="calendar.action_calendar_event" model="ir.actions.act_window">
<field name="context">{
'ur_sidebar_filter': True,
'search_default_this_trimester': True,
}</field>
</record>
<record id="action_calendar_my_events" model="ir.actions.act_window">
<field name="name">Mes Rendez-vous</field>
<field name="res_model">calendar.event</field>
<field name="view_mode">calendar,tree,form</field>
<field name="view_id" ref="calendar.view_calendar_event_calendar"/>
<field name="search_view_id" ref="calendar.view_calendar_event_search"/>
<field name="view_mode">calendar,tree,form</field>
<field name="context">{
'ur_sidebar_filter': True,
'search_default_mymeetings': True
}</field>
</record>
<!-- Ressource Action -->
<record id="action_calendar_scop" model="ir.actions.act_window">
<field name="name">Agenda UR</field>
<field name="res_model">calendar.event</field>
<field name="view_mode">resource,calendar,tree,form</field>
<field name="search_view_id" ref="calendar.view_calendar_event_search"/>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'resource', 'view_id': ref('view_calendar_cooperative_resource')}),
(0, 0, {'view_mode': 'calendar', 'view_id': ref('calendar.view_calendar_event_calendar')}),
(0, 0, {'view_mode': 'tree', 'view_id': ref('calendar.view_calendar_event_tree')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('calendar.view_calendar_event_form')})]"/>
</record>
<!-- ******************************
*** Menus
****************************** -->
<menuitem
id="mail_submenu_calendar"
name="Calendrier"
parent="calendar.mail_menu_calendar"
sequence="1"/>
<menuitem
id="menu_calendar_scop_all"
parent="mail_submenu_calendar"
name="Toutes les entrées"
sequence="1"
action="calendar.action_calendar_event"
groups="base.group_user"/>
<menuitem
id="menu_calendar_scop_my_events"
parent="mail_submenu_calendar"
name="Mes rendez-vous"
sequence="10"
action="action_calendar_my_events"
groups="base.group_user"/>
<menuitem
id="menu_calendar_scop"
parent="calendar.mail_menu_calendar"
name="Agenda UR"
sequence="2"
action="action_calendar_scop"
groups="base.group_user"/>