Nimesh Contractor(Open ERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-caldav_recurrent_fix-nco into 
lp:openobject-addons.

Requested reviews:
  Harry (OpenERP) (hmo-tinyerp)
  Atul Patel(OpenERP) (atp-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-caldav_recurrent_fix-nco/+merge/91829

Hello sir,

          As per your suggestion I have override the browse method to browse 
the record of recurrent event id.

          And fix the recurrent event date problem.

Thanks,
 NCO.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-caldav_recurrent_fix-nco/+merge/91829
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-caldav_recurrent_fix-nco.
=== modified file 'base_calendar/base_calendar.py'
--- base_calendar/base_calendar.py	2012-02-03 12:42:14 +0000
+++ base_calendar/base_calendar.py	2012-02-07 13:46:22 +0000
@@ -1121,7 +1121,6 @@
         @param limit: The Number of Results to Return """
         if not context:
             context = {}
-
         result = []
         for data in super(calendar_event, self).read(cr, uid, select, context=context):
             if not data['rrule']:
@@ -1170,9 +1169,7 @@
 
         if isinstance(select, (str, int, long)):
             return ids and ids[0] or False
-        else:
-            ids = list(set(result))
-        return ids
+        return result
 
     def compute_rule_string(self, datas):
         """
@@ -1419,7 +1416,27 @@
                     del re[groupname + "_count"]
             re.get('__context', {}).update({'virtual_id' : virtual_id})
         return res
+    def browse(self, cr, uid, ids, context=None, list_class=None, fields_process=None):
+        """
+        Overrides orm browse method.
+        @param self: the object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param ids: List of crm meeting's ids
+        @param context: A standard dictionary for contextual values
+        @return: the object list.
+        """
+        if isinstance(ids, (str, int, long)):
+            select = [ids]
+        else:
+            select = ids
+        select = map(lambda x: base_calendar_id2real_id(x), select)
+        res = super(calendar_event, self).browse(cr, uid, select, context, \
+                                                    list_class, fields_process)
+        if isinstance(ids, (str, int, long)):
+            return res and res[0] or False
 
+        return res
     def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'):
         # FIXME This whole id mangling has to go!
         if context is None:

=== modified file 'caldav/calendar.py'
--- caldav/calendar.py	2011-10-27 21:11:24 +0000
+++ caldav/calendar.py	2012-02-07 13:46:22 +0000
@@ -372,7 +372,8 @@
                         model_obj = self.pool.get(model)
                         r_ids = []
                         if model_obj._columns.get('recurrent_uid', None):
-                            cr.execute('SELECT id FROM %s WHERE recurrent_uid=%%s' % model_obj._table,
+                            if (map_field == "recurrent_ids"): 
+                                cr.execute('SELECT id FROM %s WHERE recurrent_uid=%%s' % model_obj._table,
                                         (data[map_field],))
                             r_ids = map(lambda x: x[0], cr.fetchall())
                         if r_ids:

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to