changeset 1caebd46a447 in trytond:5.2
details: https://hg.tryton.org/trytond?cmd=changeset;node=1caebd46a447
description:
        Skip check access on ir.ui.menu for wizard

        User launching a wizard from menu should not need write access on the 
menu.

        issue9173
        review301161002
        (grafted from c9b0bdd34b75bd5f6504d202ea0dacefe571130b)
diffstat:

 trytond/wizard/wizard.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r f6f8c84534be -r 1caebd46a447 trytond/wizard/wizard.py
--- a/trytond/wizard/wizard.py  Tue Mar 17 23:21:20 2020 +0100
+++ b/trytond/wizard/wizard.py  Thu Mar 26 00:12:43 2020 +0100
@@ -226,7 +226,7 @@
 
         with Transaction().set_context(_check_access=True):
             model = context.get('active_model')
-            if model:
+            if model and model != 'ir.ui.menu':
                 ModelAccess.check(model, 'read')
             groups = set(User.get_groups())
             wizard_groups = ActionWizard.get_groups(cls.__name__,
@@ -235,7 +235,7 @@
                 if not groups & wizard_groups:
                     raise UserError('Calling wizard %s is not allowed!'
                         % cls.__name__)
-            elif model:
+            elif model and model != 'ir.ui.menu':
                 ModelAccess.check(model, 'write')
 
     @classmethod

Reply via email to