From f8bd8b8cec2ce0b73cb8d31c4929a71d12aa9483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 7 Jul 2009 19:39:58 +0200 Subject: [PATCH] Test has_lock before calling LOCK --- move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/move.py b/move.py index a26cb71c24..9c12c5dd54 100644 --- a/move.py +++ b/move.py @@ -625,7 +625,8 @@ class Move(ModelSQL, ModelView): if context is None: context = {} - cursor.execute('LOCK TABLE stock_move') + if cursor.has_lock(): + cursor.execute('LOCK TABLE stock_move') local_ctx = context and context.copy() or {} local_ctx['stock_date_end'] = date_obj.today(cursor, user,