document, caldav: revert changes that are not needed and spacing

Let's keep the diff against trunk-dev-addons1 only to things that
make sense.

bzr revid: p_christ@hol.gr-20101223141639-o13v6llljplpgl7s
This commit is contained in:
P. Christeas 2010-12-23 16:16:39 +02:00
parent 6d38e064e2
commit 8e8803e9df
5 changed files with 7 additions and 13 deletions

View File

@ -148,7 +148,6 @@ def get_attribute_mapping(cr, uid, calname, context=None):
@param calname: Get Calendar name
@param context: A standard dictionary for contextual values """
if context is None:
context = {}
pool = pooler.get_pool(cr.dbname)
@ -230,7 +229,6 @@ def map_data(cr, uid, obj, context=None):
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)
@ -904,6 +902,7 @@ class basic_calendar_fields(osv.osv):
@param vals: Get Values
@param context: A standard dictionary for contextual values
"""
if not vals:
return
for id in ids:
@ -1296,5 +1295,4 @@ class Attendee(CalDAV, osv.osv_memory):
Attendee()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -22,4 +22,5 @@
import calendar_event_export
import calendar_event_import
import calendar_event_subscribe
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -44,7 +44,6 @@ class crm_meeting(osv.osv):
ical = event_obj.export_cal(cr, uid, event_data, context=context)
return ical.serialize()
def import_cal(self, cr, uid, data, data_id=None, context=None):
"""
@param self: The object pointer
@ -89,7 +88,6 @@ class crm_meeting(osv.osv):
val.update({'recurrent_uid': exists})
model_obj.write(cr, uid, [r_id], val)
ids.append(r_id)
elif exists:
model_obj.write(cr, uid, [exists], val)
ids.append(exists)

View File

@ -53,8 +53,7 @@ class document_file(osv.osv):
if context is None:
context = {}
fbrl = self.browse(cr, uid, ids, context=context)
nctx = nodes.get_node_context(cr, uid, context=context)
nctx = nodes.get_node_context(cr, uid, context={})
# nctx will /not/ inherit the caller's context. Most of
# it would be useless, anyway (like active_id, active_model,
# bin_size etc.)
@ -67,7 +66,9 @@ class document_file(osv.osv):
result[fbro.id] = base64.encodestring(data or '')
else:
result[fbro.id] = fnode.get_data_len(cr, fbro)
return result
#
# This code can be improved
#
@ -178,7 +179,7 @@ class document_file(osv.osv):
ids2 = []
for fbro in self.browse(cr, uid, ids, context=context):
if ('parent_id' not in vals or fbro.parent_id.id == vals['parent_id']) \
and ('name' not in vals or fbro.name == vals['name']) or not fbro.parent_id:
and ('name' not in vals or fbro.name == vals['name']):
ids2.append(fbro.id)
continue
fnode = nctx.get_file_node(cr, fbro)

View File

@ -525,9 +525,6 @@ class node_dir(node_database):
# TODO: the write date should be MAX(file.write)..
self.write_date = dirr and (dirr.write_date or dirr.create_date) or False
self.content_length = 0
self.unixperms = 040750
try:
self.uuser = (dirr.user_id and dirr.user_id.login) or 'nobody'
except Exception:
@ -767,7 +764,6 @@ class node_res_dir(node_class):
# TODO: the write date should be MAX(file.write)..
self.write_date = dirr.write_date or dirr.create_date
self.content_length = 0
self.unixperms = 040750
try:
self.uuser = (dirr.user_id and dirr.user_id.login) or 'nobody'
except Exception:
@ -1560,4 +1556,4 @@ class nodefd_static(StringIO, node_descriptor):
cr.close()
StringIO.close(self)
#eof
#eof