From 522b77fdfacaeef1e39e7daf085a648ba949356b Mon Sep 17 00:00:00 2001 From: "Yogesh (OpenERP)" Date: Wed, 1 Jun 2011 15:19:08 +0530 Subject: [PATCH] [FIX] fix problem of variable name. bzr revid: ysa@tinyerp.com-20110601094908-9o24f6ohms7fx6p9 --- openerp/osv/osv.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openerp/osv/osv.py b/openerp/osv/osv.py index ae25d82893b..57704354221 100644 --- a/openerp/osv/osv.py +++ b/openerp/osv/osv.py @@ -79,7 +79,7 @@ class object_proxy(netsvc.Service): # We open a *new* cursor here, one reason is that failed SQL # queries (as in IntegrityError) will invalidate the current one. cr = False - + if hasattr(src, '__call__'): # callable. We need to find the right parameters to call # the orm._sql_message(self, cr, uid, ids, context) function, @@ -92,18 +92,18 @@ class object_proxy(netsvc.Service): ids = args[3] else: ids = [] - cr = sql_db.db_connect(db_name).cursor() + cr = sql_db.db_connect(dbname).cursor() return src(obj, cr, uid, ids, context=(ctx or {})) except Exception: pass finally: if cr: cr.close() - + return False # so that the original SQL error will # be returned, it is the best we have. try: - cr = sql_db.db_connect(db_name).cursor() + cr = sql_db.db_connect(dbname).cursor() res = translate(cr, name=False, source_type=ttype, lang=lang, source=src) if res: