← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-client/trunk-bugfixes-nch into lp:openobject-client

 

Naresh(OpenERP) has proposed merging lp:~openerp-dev/openobject-client/trunk-bugfixes-nch into lp:openobject-client.

Requested reviews:
  OpenERP sa GTK client R&D (openerp-dev-gtk)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client/trunk-bugfixes-nch/+merge/56138

[FIX]:search_view returning value in list should parse correctly	
[FIX]:domain setup in custom filters		
[FIX]:O2M switch empty	
[FIX]:unselect_row should be available only for list view		
[FIX]:attrs used to set readonly was misbehaving	
[FIX]:STOCK_* Icons from server were not used in filters	
[FIX]:O2M pager total count not updated when we set default records in O2M thru _defaults
-- 
https://code.launchpad.net/~openerp-dev/openobject-client/trunk-bugfixes-nch/+merge/56138
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-client/trunk-bugfixes-nch.
=== modified file 'bin/widget/model/record.py'
--- bin/widget/model/record.py	2011-03-22 12:31:23 +0000
+++ bin/widget/model/record.py	2011-04-04 11:47:27 +0000
@@ -227,6 +227,8 @@
             # with on_change() in case they cascade, but that's fixable
             # normally in the view a single clean on_change on the first
             # field.
+            if isinstance(self.mgroup.mfields[fieldname], O2MField):
+                 self.pager_cache[fieldname] = value
             if self.mgroup.mfields[fieldname].attrs.get('on_change',False):
                 fields_with_on_change[fieldname] = value
             else:

=== modified file 'bin/widget/screen/screen.py'
--- bin/widget/screen/screen.py	2011-02-11 06:59:40 +0000
+++ bin/widget/screen/screen.py	2011-04-04 11:47:27 +0000
@@ -916,7 +916,7 @@
                 if isinstance(wid, gtk.Button) and \
                     not isinstance(wid.parent, (gtk.HBox,gtk.VBox)):
                     wid.set_sensitive(val)
-        if value and not self.current_model.id:
+        if value and self.current_model and not self.current_model.id:
             return True
         process(self.widget, value)
 

=== modified file 'bin/widget/view/form_gtk/many2one.py'
--- bin/widget/view/form_gtk/many2one.py	2010-12-03 11:55:42 +0000
+++ bin/widget/view/form_gtk/many2one.py	2011-04-04 11:47:27 +0000
@@ -230,7 +230,6 @@
     def _readonly_set(self, value):
         self._readonly = value
         self.wid_text.set_editable(not value)
-        self.wid_text.set_sensitive(not value)
         self.but_find.set_sensitive(not value)
 
     def _color_widget(self):

=== modified file 'bin/widget/view/form_gtk/one2many_list.py'
--- bin/widget/view/form_gtk/one2many_list.py	2011-03-28 09:11:21 +0000
+++ bin/widget/view/form_gtk/one2many_list.py	2011-04-04 11:47:27 +0000
@@ -422,8 +422,9 @@
         self.pager.search_count()
         self.pager.set_sensitivity()
         self.screen.display()
-        if not self.model_field.get_state_attrs(model).get('valid', True):
-            self.screen.current_view.unselect_row(True)
+        if self.screen.current_view.view_type=='tree':
+            if not self.model_field.get_state_attrs(model).get('valid', True):
+                self.screen.current_view.unselect_row(True)
         return True
 
     def set_value(self, model, model_field):

=== modified file 'bin/widget/view/form_gtk/parser.py'
--- bin/widget/view/form_gtk/parser.py	2011-03-28 09:11:21 +0000
+++ bin/widget/view/form_gtk/parser.py	2011-04-04 11:47:27 +0000
@@ -135,7 +135,7 @@
         self.widget = widget
         self.label = label
         self.states = states or []
-        self.frame_child = {}
+        self.group_child = {}
 
     def __getattr__(self, a):
         return self.widget.__getattribute__(a)
@@ -160,24 +160,11 @@
                     getattr(self.label, func)()
             elif k == 'readonly':
                 if isinstance(self.widget, gtk.Frame):
-                    for name, wid in self.frame_child.iteritems():
-                        self.set_sensitive(wid, result)
+                    for name, wid in self.group_child.iteritems():
+                        wid.set_sensitive(not result)
                 else:
-                    self.set_sensitive(self.widget, result)
-    ## This method is hacked here because field labels that are readonly
-    ## should not change their looks to readonly GTK widgets as it makes
-    ## the label text very difficult to read in some themes.
-    def set_sensitive(self, widget, value):
-        if hasattr(widget, "get_children") and not \
-            isinstance(widget, gtk.ComboBoxEntry):
-            for wid in widget.get_children():
-               self.set_sensitive(wid, value)
-        if not isinstance(widget, gtk.Label):
-            if hasattr(widget,'_readonly_set'):
-                widget._readonly_set(value)
-            else:
-                widget.set_sensitive(not value)
-        return True
+                    self.widget.set_sensitive(not result)
+
 
 class _container(object):
     def __init__(self):
@@ -212,7 +199,7 @@
 
     def create_label(self, name, markup=False, align=1.0, wrap=False,
                      angle=None, width=None, fname=None, help=None, detail_tooltip=False):
-        
+
         label = gtk.Label(name)
         eb = gtk.EventBox()
         eb.set_events(gtk.gdk.BUTTON_PRESS_MASK)
@@ -220,7 +207,7 @@
             label.set_use_markup(True)
         self.trans_box_label.append((eb, name, fname))
         eb.add(label)
-        
+
         def size_allocate(label, allocation):
             label.set_size_request( allocation.width - 2, -1 )
         if fname is None and name and len(name) > 50:
@@ -396,13 +383,13 @@
                     visval = eval(attrs['invisible'], {'context':self.screen.context})
                     if visval:
                         continue
-                    
+
                 if 'default_focus' in attrs and not self.default_focus_button:
                     attrs['focus_button'] = attrs['default_focus']
                     self.default_focus_button = True
-              
+
                 button = Button(attrs)
-                
+
                 states = [e for e in attrs.get('states','').split(',') if e]
                 saw_list.append(StateAwareWidget(button, states=states))
                 container.wid_add(button.widget, colspan=int(attrs.get('colspan', 1)))
@@ -532,7 +519,7 @@
                 container.wid_add(group_wid, colspan=int(attrs.get('colspan', 1)), expand=int(attrs.get('expand',0)), rowspan=int(attrs.get('rowspan', 1)), ypadding=0, fill=int(attrs.get('fill', 1)))
                 container.new(int(attrs.get('col',4)))
                 widget, widgets, saws, on_write = self.parse(model, node, fields)
-                state_aware.frame_child.update(widgets)
+                state_aware.group_child.update(widgets)
                 dict_widget.update(widgets)
                 saw_list += saws
                 frame.add(widget)
@@ -684,7 +671,7 @@
             # Make sure the context won't mutate
             context = copy.copy(rpc.session.context)
             context['lang'] = lang['code']
-            # Read the string in this language 
+            # Read the string in this language
             val = rpc.session.rpc_exec_auth('/object', 'execute', model,
                     'read', [id], [name], context)
             val = val[0]
@@ -710,7 +697,7 @@
                 value_set(entry,value_get(widget_entry))
             else:
                 value_set(entry,val[name])
-            
+
             entries_list.append((lang['code'], entry))
             table.attach(label, 0, 1, i, i+1, yoptions=False, xoptions=gtk.FILL,
                     ypadding=2, xpadding=5)
@@ -728,7 +715,7 @@
         sv.add(vp)
         win.vbox.add(sv)
         win.show_all()
-        
+
         # process the response
         ok = False
         data = []

=== modified file 'bin/widget_search/filter.py'
--- bin/widget_search/filter.py	2010-12-13 15:45:20 +0000
+++ bin/widget_search/filter.py	2011-04-04 11:47:27 +0000
@@ -35,7 +35,10 @@
             self.butt = gtk.ToggleButton()
             self.butt.set_relief(gtk.RELIEF_NONE)
         icon = gtk.Image()
-        icon.set_from_stock(attrs.get('icon','gtk-home'), 1)
+        icon_to_set = attrs.get('icon','gtk-home')
+        if icon_to_set.startswith('STOCK'):
+            icon_to_set = eval('gtk.'+ icon_to_set)
+        icon.set_from_stock(icon_to_set, 1)
         self.butt.set_image(icon)
         self.butt.set_image_position(gtk.POS_TOP)
         self.butt.modify_bg(gtk.STATE_ACTIVE, gtk.gdk.color_parse("grey"))

=== modified file 'bin/widget_search/selection.py'
--- bin/widget_search/selection.py	2011-01-17 19:11:21 +0000
+++ bin/widget_search/selection.py	2011-04-04 11:47:27 +0000
@@ -38,6 +38,8 @@
         if 'selection' in attrs:
             self.set_popdown(attrs.get('selection',[]))
         if self.default_search:
+            if isinstance(self.default_search,list):
+                self.default_search = self.default_search[0]
             if self.attrs['type'] == 'many2one':
                 self._value_set(int(self.default_search))
             else:


Follow ups