Mohammed Shekha(Open ERP) has proposed merging 
lp:~openerp-dev/openobject-client-web/6.0-bug-14811-msh into 
lp:openobject-client-web/6.0.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-bug-14811-msh/+merge/67301

Hello,

When in calendar view new user creates an event at that time color of users 
have been interchanged.
-- 
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-bug-14811-msh/+merge/67301
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client-web/6.0-bug-14811-msh.
=== modified file 'addons/view_calendar/widgets/_base.py'
--- addons/view_calendar/widgets/_base.py	2011-06-30 05:04:45 +0000
+++ addons/view_calendar/widgets/_base.py	2011-07-08 09:51:39 +0000
@@ -271,7 +271,7 @@
         ids = proxy.search(domain, 0, 0, order_by, ctx)
 
         result = proxy.read(ids, self.fields.keys()+['__last_update'], ctx)
-
+        
         ConcurrencyInfo.update(self.model, result)
         self.concurrency_info = ConcurrencyInfo(self.model, ids)
         if self.color_field:
@@ -284,13 +284,15 @@
 
                 if isinstance(key, tuple): # M2O
                     value, name = key
-
-                self.colors[key] = (name, value, None)
-
-            colors = choice_colors(len(self.colors))
-            for i, (key, value) in enumerate(self.colors.items()):
-                self.colors[key] = (value[0], value[1], colors[i])
-
+                if key not in self.colors:
+                    self.colors[key] = (name, value, None)
+            
+            self.colors = sorted(self.colors.items(), key=lambda x: x[0])
+            colors = choice_colors(len(dict(self.colors)))
+            for i in range(0,len(dict(self.colors))):
+                self.colors[i] = ((self.colors[i][0][0],self.colors[i][0][1]),(self.colors[i][1][0], self.colors[i][1][1], colors[i]))
+            self.colors = dict(self.colors)
+            
         events = []
 
         for evt in result:

_______________________________________________
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