From f6c88941f505575240c8afc4a2fc2be6b2ecb9f4 Mon Sep 17 00:00:00 2001 From: "Yogesh (OpenERP)" Date: Mon, 20 Jun 2011 16:33:30 +0530 Subject: [PATCH] [FIX] fix problem of improve condtion of checking key is available in dict. lp bug: https://launchpad.net/bugs/799637 fixed bzr revid: ysa@tinyerp.com-20110620110330-brg01vy68rmo6wiq --- openerp/osv/orm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 6451dc67186..6274aac008b 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -1289,15 +1289,15 @@ class orm_template(object): res[f]['readonly'] = True res[f]['states'] = {} - if hasattr(res[f], 'string'): + if 'string' in res[f]: res_trans = translation_obj._get_source(cr, user, self._name + ',' + f, 'field', context.get('lang', False) or 'en_US') if res_trans: res[f]['string'] = res_trans - if hasattr(res[f], 'help'): + if 'help' in res[f]: help_trans = translation_obj._get_source(cr, user, self._name + ',' + f, 'help', context.get('lang', False) or 'en_US') if help_trans: res[f]['help'] = help_trans - if hasattr(res[f], 'selection'): + if 'selection' in res[f]: if isinstance(field.selection, (tuple, list)): sel = field.selection sel2 = []