From 06ad86b02d55b480b092623d60e4cf4967836107 Mon Sep 17 00:00:00 2001 From: Jay Vora Date: Wed, 27 Aug 2008 19:40:27 +0530 Subject: [PATCH] Bugfix:Toolbar attribute for menu and tree. [openobject-client @ jvo@tinyerp.com-20080827141027-cgzjf8htf479cqbh] --- bin/modules/gui/window/tree.py | 16 ++++++++-------- bin/widget/view/form_gtk/picture.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/modules/gui/window/tree.py b/bin/modules/gui/window/tree.py index ad1b924f..82152491 100644 --- a/bin/modules/gui/window/tree.py +++ b/bin/modules/gui/window/tree.py @@ -109,7 +109,6 @@ class tree(object): self.tree_sc.update() ids = rpc.session.rpc_exec_auth('/object', 'execute', self.model, 'search', self.domain2) if self.tree_res.toolbar: - icon_name = 'icon' wid = self.glade.get_widget('tree_toolbar') for w in wid.get_children(): @@ -124,13 +123,14 @@ class tree(object): rb.set_label_widget(l) icon = gtk.Image() - if hasattr(r[icon_name], 'startswith') and r[icon_name].startswith('STOCK_'): - icon.set_from_stock(getattr(gtk, r[icon_name]), gtk.ICON_SIZE_BUTTON) - else: - try: - icon.set_from_stock(r[icon_name], gtk.ICON_SIZE_BUTTON) - except: - pass + if icon_name in r: + if hasattr(r[icon_name], 'startswith') and r[icon_name].startswith('STOCK_'): + icon.set_from_stock(getattr(gtk, r[icon_name]), gtk.ICON_SIZE_BUTTON) + else: + try: + icon.set_from_stock(r[icon_name], gtk.ICON_SIZE_BUTTON) + except: + pass hb = gtk.HBox(spacing=6) hb.pack_start(icon) diff --git a/bin/widget/view/form_gtk/picture.py b/bin/widget/view/form_gtk/picture.py index 5160f212..b22f8b7e 100644 --- a/bin/widget/view/form_gtk/picture.py +++ b/bin/widget/view/form_gtk/picture.py @@ -51,7 +51,7 @@ class wid_picture(interface.widget_interface): super(wid_picture, self).display(model, model_field) value = model_field.get(model) self._value = value - if isinstance(value, tuple): + if (isinstance(value, tuple) or isinstance(value,list)) and len(value)==2: type, data = value else: type, data = 'jpeg', value -- 2.11.4.GIT