From 1b5576af4658b979b97976e23030a03c167d3bc8 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 8 May 2015 16:38:46 +0200 Subject: [PATCH] [FIX] sql_db: add `closed` property on `Cursor`. --- openerp/sql_db.py | 6 ++++++ 1 file changed, 6 insertions(+) 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.