CalDAV wizards: Set the uid in the context, just like the nodes would do.
authorP. Christeas <p_christ@hol.gr>
Thu, 14 Oct 2010 11:42:16 +0000 (14:42 +0300)
committerP. Christeas <p_christ@hol.gr>
Thu, 14 Oct 2010 11:42:16 +0000 (14:42 +0300)
bzr revid: p_christ@hol.gr-20101014114216-lswnmers6kyywyom

addons/caldav/wizard/calendar_event_export.py
addons/caldav/wizard/calendar_event_import.py
addons/caldav/wizard/calendar_event_subscribe.py

index ea90686..0a55f8b 100644 (file)
@@ -37,8 +37,11 @@ class calendar_event_export(osv.osv_memory):
         """
         Get Default value for Name field.
         """
-        if not context:
+        if context is None:
             context = {}
+        else:
+            context= context.copy()
+        context['uid'] = uid
         model = context.get('model', 'basic.calendar')
         model_obj = self.pool.get(model)
         res = super(calendar_event_export, self).default_get( cr, uid, fields, context=context)
index 875e48d..11f9f9b 100644 (file)
@@ -42,6 +42,11 @@ class calendar_event_import(osv.osv_memory):
         @param ids: List of calendar event import’s IDs
         @return: dictionary of calendar evet import  window with Import successful msg.
         """
+        if context is None:
+            context = {}
+        else:
+            context = context.copy()
+        context['uid'] = uid
 
         for data in self.read(cr, uid, ids):
             model = data.get('model', 'basic.calendar')
index de673b5..f8dc761 100644 (file)
@@ -44,6 +44,12 @@ class calendar_event_subscribe(osv.osv_memory):
         @return: dictionary of calendar evet subscribe  window with Import successful msg.
         """
         global cnt
+        if context is None:
+            context = {}
+        else:
+            context = context.copy()
+        context['uid'] = uid
+
         for data in self.read(cr, uid, ids):
             try:
                 f =  urllib.urlopen(data['url_path'])