From e21d4ab5dbc4194fafb86ffa24fe7a409165c021 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 25 Jun 2008 18:22:28 +0000 Subject: [PATCH] dynamic attachment icon: no need to re-get the id [openobject-client @ chs@tinyerp.com-510f6f605e80351402a085f5b2232663b6dca512] --- bin/modules/gui/main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/modules/gui/main.py b/bin/modules/gui/main.py index ab459a73..39e9f5fc 100644 --- a/bin/modules/gui/main.py +++ b/bin/modules/gui/main.py @@ -890,12 +890,11 @@ class terp_main(service.Service): current_view = self._wid_get() current_id = current_view and current_view.id_get() if current_view == view and objid == current_id: - id = view and view.id_get() cpt = None - if id and view.screen.current_view.view_type == 'form': + if objid and view.screen.current_view.view_type == 'form': cpt = rpc.session.rpc_exec_auth('/object', 'execute', 'ir.attachment', 'search_count', - [('res_model','=',view.model), ('res_id', '=',id)]) + [('res_model', '=', view.model), ('res_id', '=', objid)]) if cpt: self.buttons['but_attach'].set_icon_widget(self.__img_attachments) self.buttons['but_attach'].set_label(_('Attachments (%d)') % cpt) -- 2.11.4.GIT