caldav: fix english strings, defaults, prepare code for abs. triggers
bzr revid: p_christ@hol.gr-20101209100105-6l33me2nvqla7e9c
This commit is contained in:
@@ -579,8 +579,8 @@ class Calendar(CalDAV, osv.osv):
|
||||
string="Type", size=64),
|
||||
'line_ids': fields.one2many('basic.calendar.lines', 'calendar_id', 'Calendar Lines'),
|
||||
'create_date': fields.datetime('Created Date', readonly=True),
|
||||
'write_date': fields.datetime('Modifided Date', readonly=True),
|
||||
'description': fields.text("description"),
|
||||
'write_date': fields.datetime('Write Date', readonly=True),
|
||||
'description': fields.text("Description"),
|
||||
'calendar_color': fields.char('Color', size=20, help="For supporting clients, the color of the calendar entries"),
|
||||
'calendar_order': fields.integer('Order', help="For supporting clients, the order of this folder among the calendars"),
|
||||
'has_webcal': fields.boolean('WebCal', required=True, help="Also export a <name>.ics entry next to the calendar folder, with WebCal content."),
|
||||
@@ -818,6 +818,7 @@ class basic_calendar_fields(osv.osv):
|
||||
|
||||
_name = 'basic.calendar.fields'
|
||||
_description = 'Calendar fields'
|
||||
_order = 'name'
|
||||
|
||||
_columns = {
|
||||
'field_id': fields.many2one('ir.model.fields', 'OpenObject Field'),
|
||||
@@ -833,7 +834,7 @@ class basic_calendar_fields(osv.osv):
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'fn': lambda *a: 'field',
|
||||
'fn': 'field',
|
||||
}
|
||||
|
||||
_sql_constraints = [
|
||||
@@ -1165,11 +1166,16 @@ class Alarm(CalDAV, osv.osv_memory):
|
||||
self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, ctx)
|
||||
for child in ical_data.getChildren():
|
||||
if child.name.lower() == 'trigger':
|
||||
seconds = child.value.seconds
|
||||
days = child.value.days
|
||||
diff = (days * 86400) + seconds
|
||||
interval = 'days'
|
||||
related = 'before'
|
||||
if isinstance(child.value, timedelta):
|
||||
seconds = child.value.seconds
|
||||
days = child.value.days
|
||||
diff = (days * 86400) + seconds
|
||||
interval = 'days'
|
||||
related = 'before'
|
||||
elif isinstance(child.value, datetime):
|
||||
# TODO
|
||||
# remember, spec says this datetime is in UTC
|
||||
raise NotImplementedError("we cannot parse absolute triggers")
|
||||
if not seconds:
|
||||
duration = abs(days)
|
||||
related = days > 0 and 'after' or 'before'
|
||||
|
||||
Reference in New Issue
Block a user