[REF] calendar: rename 'class' field on calendar.event
'class' is a reserved name in python. This will cause problem during new API migration.
This commit is contained in:
@@ -901,7 +901,7 @@ class calendar_event(osv.Model):
|
||||
'stop_datetime': fields.datetime('End Datetime', states={'done': [('readonly', True)]}, track_visibility='onchange'), # old date_deadline
|
||||
'duration': fields.float('Duration', states={'done': [('readonly', True)]}),
|
||||
'description': fields.text('Description', states={'done': [('readonly', True)]}),
|
||||
'class': fields.selection([('public', 'Everyone'), ('private', 'Only me'), ('confidential', 'Only internal users')], 'Privacy', states={'done': [('readonly', True)]}),
|
||||
'privacy': fields.selection([('public', 'Everyone'), ('private', 'Only me'), ('confidential', 'Only internal users')], 'Privacy', states={'done': [('readonly', True)]}, oldname='class'),
|
||||
'location': fields.char('Location', help="Location of Event", track_visibility='onchange', states={'done': [('readonly', True)]}),
|
||||
'show_as': fields.selection([('free', 'Free'), ('busy', 'Busy')], 'Show Time as', states={'done': [('readonly', True)]}),
|
||||
|
||||
@@ -950,7 +950,7 @@ class calendar_event(osv.Model):
|
||||
'rrule_type': False,
|
||||
'allday': False,
|
||||
'state': 'draft',
|
||||
'class': 'public',
|
||||
'privacy': 'public',
|
||||
'show_as': 'busy',
|
||||
'month_by': 'date',
|
||||
'interval': 1,
|
||||
@@ -1657,7 +1657,7 @@ class calendar_event(osv.Model):
|
||||
if context is None:
|
||||
context = {}
|
||||
fields2 = fields and fields[:] or None
|
||||
EXTRAFIELDS = ('class', 'user_id', 'duration', 'allday', 'start', 'start_date', 'start_datetime', 'rrule')
|
||||
EXTRAFIELDS = ('privacy', 'user_id', 'duration', 'allday', 'start', 'start_date', 'start_datetime', 'rrule')
|
||||
for f in EXTRAFIELDS:
|
||||
if fields and (f not in fields):
|
||||
fields2.append(f)
|
||||
@@ -1695,7 +1695,7 @@ class calendar_event(osv.Model):
|
||||
user_id = type(r['user_id']) in (tuple, list) and r['user_id'][0] or r['user_id']
|
||||
if user_id == uid:
|
||||
continue
|
||||
if r['class'] == 'private':
|
||||
if r['privacy'] == 'private':
|
||||
for f in r.keys():
|
||||
recurrent_fields = self._get_recurrent_fields(cr, uid, context=context)
|
||||
public_fields = list(set(recurrent_fields + ['id', 'allday', 'start', 'stop', 'display_start', 'display_stop', 'duration', 'user_id', 'state', 'interval', 'count', 'recurrent_id_date', 'rrule']))
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
</record>
|
||||
|
||||
<record id="action_calendar_event_type" model="ir.actions.act_window">
|
||||
<field name="name">Meeting Types</field>
|
||||
@@ -61,7 +61,7 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_calendar_alarm_tree"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Calendar Events Form View -->
|
||||
|
||||
<record model="ir.ui.view" id="view_calendar_event_form">
|
||||
@@ -173,14 +173,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<group>
|
||||
<field name="class"/>
|
||||
<field name="privacy"/>
|
||||
<field name="show_as"/>
|
||||
<field name="rrule" invisible="1" readonly="0" />
|
||||
<field name="rrule" invisible="1" readonly="0" />
|
||||
<field name="recurrent_id" invisible="1" />
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
|
||||
|
||||
<page string="Invitations" groups="base.group_no_one">
|
||||
<button name="do_sendmail" type="object" string="Send mail" icon="fa-envelope" class="oe_link"/>
|
||||
<field name="attendee_ids" widget="one2many" >
|
||||
@@ -188,7 +188,7 @@
|
||||
<field name="partner_id" />
|
||||
<field name="state" />
|
||||
<field name="email" widget="email"/>
|
||||
|
||||
|
||||
<button name="do_tentative" states="needsAction,declined,accepted" string="Uncertain" type="object" icon="fa-asterisk" />
|
||||
<button name="do_accept" string="Accept" states="needsAction,tentative,declined" type="object" icon="fa-check text-success"/>
|
||||
<button name="do_decline" string="Decline" states="needsAction,tentative,accepted" type="object" icon="fa-times-circle text-danger"/>
|
||||
@@ -210,7 +210,7 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_calendar_event_form_popup">
|
||||
<field name="name">Meetings Dialog</field>
|
||||
<field name="model">calendar.event</field>
|
||||
@@ -268,7 +268,7 @@
|
||||
<field name="model">calendar.event</field>
|
||||
<field name="priority" eval="2"/>
|
||||
<field name="arch" type="xml">
|
||||
<calendar string="Meetings" date_start="start" date_stop="stop" date_delay="duration" all_day="allday"
|
||||
<calendar string="Meetings" date_start="start" date_stop="stop" date_delay="duration" all_day="allday"
|
||||
display="[name]" color="color_partner_id" attendee="partner_ids" avatar_model="res.partner"
|
||||
use_contacts="True" event_open_popup="%(calendar.view_calendar_event_form_popup)s">
|
||||
<field name="name"/>
|
||||
@@ -290,7 +290,7 @@
|
||||
<field name="categ_ids"/>
|
||||
<field name="user_id"/>
|
||||
<field name="show_as"/>
|
||||
<field name="class" string="Privacy"/>
|
||||
<field name="privacy" string="Privacy"/>
|
||||
<filter string="My Events" domain="[('user_id','=',uid)]" help="My Events"/>
|
||||
<filter string="My Meetings" help="My Meetings" name="mymeetings" context='{"mymeetings": 1}'/>
|
||||
<filter string="Unread Messages" name="message_needaction" domain="[('message_needaction','=',True)]"/>
|
||||
@@ -298,7 +298,7 @@
|
||||
<group expand="0" string="Group By">
|
||||
<filter string="Responsible" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Availability" domain="[]" context="{'group_by':'show_as'}"/>
|
||||
<filter string="Privacy" domain="[]" context="{'group_by':'class'}"/>
|
||||
<filter string="Privacy" domain="[]" context="{'group_by':'privacy'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -353,7 +353,7 @@
|
||||
<field name="view_mode">form,calendar,tree</field>
|
||||
<field name="view_id" ref="view_calendar_event_form"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
In Order to test calendar, I will first create One Simple Event with real data
|
||||
-
|
||||
!record {model: calendar.event, id: calendar_event_technicalpresentation0}:
|
||||
class: private
|
||||
privacy: private
|
||||
start: '2011-04-30 16:00:00'
|
||||
stop: '2011-04-30 18:30:00'
|
||||
description: The Technical Presentation will cover following topics:\n* Creating OpenERP
|
||||
@@ -46,7 +46,7 @@
|
||||
-
|
||||
!record {model: calendar.event, id: calendar_event_alldaytestevent0}:
|
||||
allday: 1
|
||||
class: confidential
|
||||
privacy: confidential
|
||||
start: '2011-04-30 00:00:00'
|
||||
stop: '2011-04-30 00:00:00'
|
||||
description: 'All day technical test '
|
||||
|
||||
@@ -435,7 +435,7 @@ class Holidays(models.Model):
|
||||
'stop': holiday.date_to,
|
||||
'allday': False,
|
||||
'state': 'open', # to block that meeting date in the calendar
|
||||
'class': 'confidential'
|
||||
'privacy': 'confidential'
|
||||
}
|
||||
#Add the partner_id (if exist) as an attendee
|
||||
if holiday.user_id and holiday.user_id.partner_id:
|
||||
|
||||
Reference in New Issue
Block a user