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

Requested reviews:
  OpenERP sa GTK client R&D (openerp-dev-gtk)
Related bugs:
  Bug #802583 in OpenERP GTK Client: "GTK client does not display anything when 
encounters unknown @widget"
  https://bugs.launchpad.net/openobject-client/+bug/802583

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client/trunk-bug-802583-nch/+merge/69590
-- 
https://code.launchpad.net/~openerp-dev/openobject-client/trunk-bug-802583-nch/+merge/69590
Your team OpenERP sa GTK client R&D is requested to review the proposed merge 
of lp:~openerp-dev/openobject-client/trunk-bug-802583-nch into 
lp:openobject-client.
=== modified file 'bin/widget/screen/screen.py'
--- bin/widget/screen/screen.py	2011-05-10 11:13:09 +0000
+++ bin/widget/screen/screen.py	2011-07-28 06:22:25 +0000
@@ -485,7 +485,7 @@
         del self.win_search
         del self.win_search_callback
         del self.window
-        
+
     def set_tooltips(self):
         terp_main = service.LocalService('gui.main')
         page_id= terp_main.notebook.get_current_page()
@@ -493,8 +493,8 @@
         action_name = form_obj.name or ''
         if self.current_view.view_type == 'form':
             tips = unicode(self.current_model and self.current_model.value.get('name') or action_name)
-            tooltips = tips == action_name and action_name or  action_name + ': ' + tips[:64] 
-            label = tips == action_name and action_name or  action_name + ': ' + tips[:6] 
+            tooltips = tips == action_name and action_name or  action_name + ': ' + tips[:64]
+            label = tips == action_name and action_name or  action_name + ': ' + tips[:6]
         else:
             tooltips = action_name
             label = action_name
@@ -599,7 +599,6 @@
                 if attrs.get('widget', False):
                     if attrs['widget']=='one2many_list':
                         attrs['widget']='one2many'
-                    attrs['type'] = attrs['widget']
                 if attrs.get('selection',[]):
                     attrs['selection'] = eval(attrs['selection'])
                     for att_key, att_val in attrs['selection'].items():

=== modified file 'bin/widget/view/form_gtk/parser.py'
--- bin/widget/view/form_gtk/parser.py	2011-04-20 09:31:42 +0000
+++ bin/widget/view/form_gtk/parser.py	2011-07-28 06:22:25 +0000
@@ -79,7 +79,7 @@
 
     def hide_all(self):
         return self.widget.hide_all()
-    
+
     def show_all(self):
         return self.widget.show_all()
 
@@ -449,13 +449,13 @@
                 name = str(attrs['name'])
                 del attrs['name']
                 name = unicode(name)
-                type = attrs.get('widget', fields[name]['type'])
+                widget_type = attrs.get('widget', False)
+                field_type = fields[name]['type']
                 if 'selection' in attrs:
                     attrs['selection'] = fields[name]['selection']
                 fields[name].update(attrs)
                 fields[name]['model'] = model
-                if not type in widgets_type:
-                    continue
+                type = widget_type in widgets_type and widget_type or field_type
 
                 fields[name]['name'] = name
                 if 'saves' in attrs:
@@ -467,12 +467,12 @@
                 if 'default_focus' in attrs and not self.default_focus_field:
                     fields[name]['focus_field'] = attrs['default_focus']
                     self.default_focus_field = True
-                
+
                 hlp = fields[name].get('help', attrs.get('help', False))
                 detail_tooltip = False
                 if options.options['debug_mode_tooltips']:
                     detail_tooltip = self.create_detail_tooltip(name, fields[name])
-                
+
                 label = None
                 if not int(attrs.get('nolabel', 0)):
                     # TODO space before ':' depends of lang (ex: english no space)
@@ -480,7 +480,7 @@
                         label = ': '+fields[name]['string']
                     else:
                         label = fields[name]['string']+' :'
-                                                
+
                 widget_label = container.create_label(label, help=hlp, fname=name, detail_tooltip=detail_tooltip) if label else None
                 widget_act = widgets_type[type][0](self.window, self.parent, model, fields[name], widget_label)
                 self.widget_id += 1
@@ -492,7 +492,7 @@
                 if attrs.get('height', False) or attrs.get('width', False):
                     widget_act.widget.set_size_request(
                             int(attrs.get('width', -1)), int(attrs.get('height', -1)))
-                
+
                 if attrs.get('invisible', False):
                     visval = eval(attrs['invisible'], {'context':self.screen.context})
                     if visval:

=== modified file 'bin/widget_search/form.py'
--- bin/widget_search/form.py	2011-06-27 09:02:09 +0000
+++ bin/widget_search/form.py	2011-07-28 06:22:25 +0000
@@ -192,11 +192,11 @@
             if node.tag =='field':
                 field_name = str(attrs['name'])
                 field_dic = self.fields[field_name]
-                type = attrs.get('widget', field_dic['type'])
+                widget_type = attrs.get('widget', False)
+                field_type = field_dic['type']
                 field_dic.update(attrs)
                 field_dic['model'] = self.model
-                if type not in widgets_type:
-                    continue
+                type = widget_type in widgets_type and widget_type or field_type
                 widget_act = widgets_type[type][0](field_name, self.parent, field_dic, screen=call[0])
                 if 'string' in field_dic:
                     label = field_dic['string']+' :'

_______________________________________________
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