mirror of
https://github.com/NaN-tic/trytond-patches.git
synced 2023-12-14 06:03:03 +01:00
Remove babi_execution_ in get_access in case model is not current available
#161937
This commit is contained in:
parent
316eacbeac
commit
9828e3b77e
|
@ -40,3 +40,24 @@ index d762a27a..5ca47c34 100644
|
||||||
related_records = Model.browse([x[0] for x in cursor])
|
related_records = Model.browse([x[0] for x in cursor])
|
||||||
else:
|
else:
|
||||||
with inactive_records():
|
with inactive_records():
|
||||||
|
diff --git a/tryton/trytond/trytond/ir/model.py b/tryton/trytond/trytond/ir/model.py
|
||||||
|
index 6304018f24..1ea08d8be5 100644
|
||||||
|
--- a/tryton/trytond/trytond/ir/model.py
|
||||||
|
+++ b/tryton/trytond/trytond/ir/model.py
|
||||||
|
@@ -555,8 +555,14 @@ class ModelAccess(DeactivableMixin, ModelSQL, ModelView):
|
||||||
|
fill_models(field.get_target(), models)
|
||||||
|
model2models = defaultdict(list)
|
||||||
|
for model in models:
|
||||||
|
- fill_models(pool.get(model), model2models[model])
|
||||||
|
-
|
||||||
|
+ try:
|
||||||
|
+ fill_models(pool.get(model), model2models[model])
|
||||||
|
+ except KeyError as err:
|
||||||
|
+ if 'babi_execution_' in str(err):
|
||||||
|
+ models.remove(model)
|
||||||
|
+ continue
|
||||||
|
+ else:
|
||||||
|
+ raise
|
||||||
|
all_models = list(set(sum(model2models.values(), [])))
|
||||||
|
default = {'read': True, 'write': True, 'create': True, 'delete': True}
|
||||||
|
default_singleton = {
|
||||||
|
|
Loading…
Reference in a new issue