changeset ce5ad8f39440 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=ce5ad8f39440
description:
        Check model read access only on wizard with table_query models

        issue9251
        review297631002
diffstat:

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

diffs (23 lines):

diff -r 40cbf6163fb7 -r ce5ad8f39440 trytond/wizard/wizard.py
--- a/trytond/wizard/wizard.py  Tue Apr 21 14:10:46 2020 +0200
+++ b/trytond/wizard/wizard.py  Sat Apr 25 08:50:14 2020 +0200
@@ -12,6 +12,7 @@
 from trytond.transaction import Transaction
 from trytond.url import URLMixin
 from trytond.protocols.jsonrpc import JSONDecoder, JSONEncoder
+from trytond.model import ModelSQL
 from trytond.model.fields import states_validate
 from trytond.pyson import PYSONEncoder
 from trytond.rpc import RPC
@@ -242,7 +243,10 @@
                     raise UserError('Calling wizard %s is not allowed!'
                         % cls.__name__)
             elif model and model != 'ir.ui.menu':
-                ModelAccess.check(model, 'write')
+                Model = pool.get(model)
+                if (not callable(getattr(Model, 'table_query', None))
+                        or Model.write.__func__ != ModelSQL.write.__func__):
+                    ModelAccess.check(model, 'write')
 
     @classmethod
     def create(cls):

Reply via email to