From e3c341f8cd2cd71b30b2187fca201321d93c7fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 3 Oct 2021 13:50:33 +0200 Subject: [PATCH] Allow locking tables by calling ModelSQL.lock without records issue10785 review359051002 --- party.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/party.py b/party.py index f6aaaad615..f3aa3908a4 100644 --- a/party.py +++ b/party.py @@ -80,7 +80,7 @@ class Party(metaclass=PoolMeta): for model in self._credit_limit_to_lock(): Model = pool.get(model) - Transaction().database.lock(Transaction().connection, Model._table) + Model.lock() if self.credit_limit_amount < self.credit_amount + amount: company = Company(Transaction().context.get('company')) lang = Lang.get()