changeset 6215c27c7767 in modules/account_fr_chorus:default
details: 
https://hg.tryton.org/modules/account_fr_chorus?cmd=changeset&node=6215c27c7767
description:
        Lock records instead of the entire table

        issue11152
        review366581003
diffstat:

 account.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r 4cde40e83ad1 -r 6215c27c7767 account.py
--- a/account.py        Sat Dec 18 16:29:38 2021 +0100
+++ b/account.py        Wed Jan 26 10:36:40 2022 +0100
@@ -190,7 +190,6 @@
         pool = Pool()
         Credential = pool.get('account.credential.chorus')
         transaction = Transaction()
-        cls.lock()
 
         if not records:
             records = cls.search(['OR',
@@ -200,9 +199,11 @@
                         transaction.context.get('company')),
                     ])
 
+        cls.lock(records)
         for record in records:
             # Use clear cache after a commit
             record = cls(record.id)
+            record.lock()
             with Transaction().set_context(**record._send_context()):
                 payload = record.get_payload()
                 resp = Credential.post('factures/deposer/flux', payload)

Reply via email to