This commit is contained in:
michel 2017-11-13 19:31:43 +01:00
parent e9d9c1bb9d
commit 1c81289236
4 changed files with 20 additions and 8 deletions

View File

@ -12,7 +12,7 @@ class Event(models.Model):
_order = 'id desc'
title = fields.Char(required=True)
# manager = fields.Many2one('coworker.users','Manager', required=True, index=True)
manager_id = fields.Many2one('coworking.coworker', 'Users', required=False, index=True)
date_start = fields.Datetime(default=fields.Date.context_today, required=True)
date_end = fields.Datetime(required=True)
@ -22,7 +22,7 @@ class Event(models.Model):
('confirmed', 'Confirmed'),
('canceled', 'Canceled')], default='draft')
participants_ids = fields.Many2many('coworking.coworker.name', string='Name')
participants_ids = fields.Many2many('coworking.coworker', string='Users')
@api.constrains('date_end')

View File

@ -18,7 +18,6 @@
<field name="coworker_type" />
<field name="company_name" />
<field name="job" />
<!-- attrs="{'invisible': [('company_name', '=', False)], 'required': [('company_name', '!=', False)]}" -->
</group>
<group name="group_right">
<field name="street" />
@ -39,7 +38,6 @@
<field name="note" />
</page>
<page string="Events" name="Events">
<!-- futur field name events -->
</page>
</notebook>
</groupe>
@ -138,7 +136,6 @@
<field name="arch" type="xml">
<calendar date_start="contact_date"
display="First contact : [name]" >
<!-- Fields used for the display text -->
<field name="name" />
</calendar>
</field>

View File

@ -4,8 +4,8 @@
<!-- Action to open Coworkers list -->
<act_window id="event_action" name="Event"
res_model="coworking.event" view_mode="form" />
<!-- Menu item to open Coworkers list -->
res_model="coworking.event" view_mode="tree,form" />
<!-- Menu item to open Event list -->
<menuitem id="event_menu" name="Event" action="event_action" />
</odoo>

View File

@ -11,7 +11,7 @@
<group name="group_top">
<group name="group_left">
<field name="title" />
<!-- <field name="manager" /> -->
<field name="manager_id" />
<field name="date_start" />
<field name="date_end" />
<field name="duration" />
@ -25,4 +25,19 @@
</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, title asc">
<field name="title" />
<field name="manager_id" />
<field name="date_start" />
<field name="participants_ids" />
<field name="statut" />
</tree>
</field>
</record>
</odoo>