@param uid: the current user’s ID for security checks,
@param calname: Get Calendar name
@param context: A standard dictionary for contextual values """
- if not context:
+
+ if context is None:
context = {}
pool = pooler.get_pool(cr.dbname)
field_obj = pool.get('basic.calendar.fields')
type_id = type_obj.search(cr, uid, domain)
fids = field_obj.search(cr, uid, [('type_id', '=', type_id[0])])
res = {}
- for field in field_obj.browse(cr, uid, fids):
+ for field in field_obj.browse(cr, uid, fids, context=context):
attr = field.name.name
res[attr] = {}
res[attr]['field'] = field.field_id.name
id = modobj.create(cr, uid, map_val, context=context)
vals[field] = id
continue
-
if field_type == 'timedelta':
if map_val:
vals[field] = (map_val.seconds/float(86400) + map_val.days)
@param vals: Get Values
@param context: A standard dictionary for contextual values
"""
- if not context:
+ if context is None:
context = {}
ids = []
model_obj = self.pool.get(context.get('model'))
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."),
}
def get_calendar_objects(self, cr, uid, ids, parent=None, domain=None, context=None):
- if not context:
+ if context is None:
context = {}
if not domain:
domain = []
def get_cal_max_modified(self, cr, uid, ids, parent=None, domain=None, context=None):
- if not context:
+ if context is None:
context = {}
if not domain:
domain = []
@param vobj: the type of object to export
@return the ical data.
"""
- if not context:
+ if context is None:
context = {}
ctx_model = context.get('model', None)
ctx_res_id = context.get('res_id', None)
ical = vobject.iCalendar()
- for cal in self.browse(cr, uid, ids):
+ for cal in self.browse(cr, uid, ids, context=context):
for line in cal.line_ids:
if ctx_model and ctx_model != line.object_id.model:
continue
@param data_id: Get Data’s ID or False
@param context: A standard dictionary for contextual values
"""
- if not context:
+ if context is None:
context = {}
vals = []
ical_data = content
_name = 'basic.calendar.fields'
_description = 'Calendar fields'
+ _order = 'name'
_columns = {
'field_id': fields.many2one('ir.model.fields', 'OpenObject Field'),
@param vals: Get Values
@param context: A standard dictionary for contextual values
"""
+
if not vals:
return
for id in ids:
@param model: Get Model's name
@param context: A standard dictionary for contextual values
"""
- if not context:
+ if context is None:
context = {}
ctx = context.copy()
ctx.update({'model': model})
@param alarm_id: Get Alarm's Id
@param context: A standard dictionary for contextual values
"""
- if not context:
- context = {}
valarm = vevent.add('valarm')
alarm_object = self.pool.get(model)
alarm_data = alarm_object.read(cr, uid, alarm_id, [])
@param ical_data: Get calendar's Data
@param context: A standard dictionary for contextual values
"""
-
+ if context is None:
+ context = {}
ctx = context.copy()
ctx.update({'model': context.get('model', None)})
self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, ctx)
@param ical_data: Get calendar's Data
@param context: A standard dictionary for contextual values
"""
-
+ if context is None:
+ context = {}
ctx = context.copy()
ctx.update({'model': context.get('model', None)})
self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, ctx)
@param attendee_ids: Get Attendee's Id
@param context: A standard dictionary for contextual values
"""
- if not context:
+ if context is None:
context = {}
attendee_object = self.pool.get(model)
ctx = context.copy()
Attendee()
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: