From 8e8803e9df4067d2c04d37e603bae76b40ecb17d Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Thu, 23 Dec 2010 16:16:39 +0200 Subject: [PATCH] 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 --- addons/caldav/calendar.py | 4 +--- addons/caldav/wizard/__init__.py | 1 + addons/crm_caldav/crm_caldav.py | 2 -- addons/document/document.py | 7 ++++--- addons/document/nodes.py | 6 +----- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py index d2898fb3e46..a70a31bc017 100644 --- a/addons/caldav/calendar.py +++ b/addons/caldav/calendar.py @@ -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: diff --git a/addons/caldav/wizard/__init__.py b/addons/caldav/wizard/__init__.py index 08b298294b2..1c45cb2a191 100644 --- a/addons/caldav/wizard/__init__.py +++ b/addons/caldav/wizard/__init__.py @@ -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: diff --git a/addons/crm_caldav/crm_caldav.py b/addons/crm_caldav/crm_caldav.py index d9709f22bc5..8ba59909143 100644 --- a/addons/crm_caldav/crm_caldav.py +++ b/addons/crm_caldav/crm_caldav.py @@ -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) diff --git a/addons/document/document.py b/addons/document/document.py index 5e6fb4646ec..874fc8b8888 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -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) diff --git a/addons/document/nodes.py b/addons/document/nodes.py index 5222c0e5dce..1b7aebcd389 100644 --- a/addons/document/nodes.py +++ b/addons/document/nodes.py @@ -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 \ No newline at end of file