diff --git a/openerp/sql_db.py b/openerp/sql_db.py index d1009113a02..2ed408e61e5 100644 --- a/openerp/sql_db.py +++ b/openerp/sql_db.py @@ -402,6 +402,12 @@ class Cursor(object): def __getattr__(self, name): return getattr(self._obj, name) + @property + def closed(self): + # NOTE: we cannot use `__getattr__` delegation as we + # should not `check` that the cursor is closed + return self._obj.closed + class TestCursor(Cursor): """ A cursor to be used for tests. It keeps the transaction open across several requests, and simulates committing, rolling back, and closing.