changeset cea1542cb019 in modules/stock:default
details: https://hg.tryton.org/modules/stock?cmd=changeset&node=cea1542cb019
description:
        Use ModelSQL lock instead of database lock

        issue10785
diffstat:

 move.py   |  2 +-
 period.py |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r a1917dccb59b -r cea1542cb019 move.py
--- a/move.py   Fri Oct 15 19:16:47 2021 +0200
+++ b/move.py   Mon Oct 18 01:22:26 2021 +0200
@@ -1111,7 +1111,7 @@
                                 datetime.date.max) > period.date
                         cursor.execute(*query)
         else:
-            database.lock(connection, cls._table)
+            cls.lock()
 
     @classmethod
     def compute_quantities_query(cls, location_ids, with_childs=False,
diff -r a1917dccb59b -r cea1542cb019 period.py
--- a/period.py Fri Oct 15 19:16:47 2021 +0200
+++ b/period.py Mon Oct 18 01:22:26 2021 +0200
@@ -102,7 +102,7 @@
         # from a different transaction. It will not be taken in the pbl
         # computation but it is quite rare because only past periods are
         # closed.
-        database.lock(connection, Move._table)
+        Move.lock()
         if database.has_select_for():
             move = Move.__table__()
             query = move.select(Literal(1), for_=For('UPDATE', nowait=True))

Reply via email to