changeset 85a9738cc0db in modules/account:6.2
details: https://hg.tryton.org/modules/account?cmd=changeset&node=85a9738cc0db
description:
        Check access to select account to reconcile

        issue11240
        review380421003
        (grafted from 1ddf373597a28566f47b8817cc3edce96fd0b446)
diffstat:

 move.py |  21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diffs (32 lines):

diff -r c191eb1a080c -r 85a9738cc0db move.py
--- a/move.py   Tue Mar 01 19:48:00 2022 +0100
+++ b/move.py   Sun Mar 06 13:45:10 2022 +0100
@@ -1752,17 +1752,18 @@
             self.show.parties = parties
             return party,
 
-        if getattr(self.show, 'accounts', None) is None:
-            self.show.accounts = self.get_accounts()
-            if not next_account():
-                return 'end'
-        if getattr(self.show, 'parties', None) is None:
-            self.show.parties = self.get_parties(self.show.account)
+        with Transaction().set_context(_check_access=True):
+            if getattr(self.show, 'accounts', None) is None:
+                self.show.accounts = self.get_accounts()
+                if not next_account():
+                    return 'end'
+            if getattr(self.show, 'parties', None) is None:
+                self.show.parties = self.get_parties(self.show.account)
 
-        while not next_party():
-            if not next_account():
-                return 'end'
-        return 'show'
+            while not next_party():
+                if not next_account():
+                    return 'end'
+            return 'show'
 
     def default_show(self, fields):
         pool = Pool()

Reply via email to