In babi_multiprocess.diff, add another patch to prevent crash when reference

fields check that the user has access rights to all models the field can point
to.

ir.attachment's resource field, for example, can refer to any model in Tryton
but babi's models may not be registered so we prevent checking permissions on
babi_execution_* models.
This commit is contained in:
Albert Cervera i Areny 2019-05-22 00:35:36 +02:00
parent 0a3fcdaa1a
commit 22e099a984
1 changed files with 16 additions and 0 deletions

View File

@ -23,3 +23,19 @@
@app.auth_required
@with_pool
diff -r d875ab180d75 trytond/ir/model.py
--- a/trytond/trytond/ir/model.py Mon May 06 14:45:35 2019 +0200
+++ b/trytond/trytond/ir/model.py Wed May 22 00:18:59 2019 +0200
@@ -587,8 +587,9 @@
# XXX Can not check access right on instance method
selection = []
for model_name, _ in selection:
- if model_name and not cls.check(model_name, mode=mode,
- raise_exception=False):
+ if (model_name and not model_name.startswith('babi_execution_')
+ and not cls.check(model_name, mode=mode,
+ raise_exception=False)):
return False
return True
else: