I just patched sql_db.py.
I know it's an horrible fix, it raises exceptions, but it breaks the infinite loop.
I hope that will help the OpenERP Team to make a better fix.
@wraps(f)
def wrapper(self, *args, **kwargs):
- if not hasattr(self, '_obj'):
+ if not (f.func_name=='__getattr__' and args==('_obj',)) and not hasattr(self, '_obj'): raise psycopg2.ProgrammingError('Unable to use the cursor after having closing it')
return f(self, *args, **kwargs)
return wrapper
I just patched sql_db.py.
I know it's an horrible fix, it raises exceptions, but it breaks the infinite loop.
I hope that will help the OpenERP Team to make a better fix.
@wraps(f) name==' __getattr_ _' and args==('_obj',)) and not hasattr(self, '_obj'):
raise psycopg2. ProgrammingErro r('Unable to use the cursor after having closing it')
def wrapper(self, *args, **kwargs):
- if not hasattr(self, '_obj'):
+ if not (f.func_
return f(self, *args, **kwargs)
return wrapper
@check
def __getattr__(self, name):
- return getattr(self._obj, name)
+ if name!='_obj':
+ return getattr(self._obj, name)
+ else:
+ return None