Commit 6761efd3 authored by Vincent Pelletier's avatar Vincent Pelletier

ERP5.Document.BusinessTemplate: Support object type changing from container to non-container.

For example, allows upgrading a Business Template when an ERP5 Form is
replaced by a PythonScript in a skin folder.
parent 6708c75a
...@@ -691,7 +691,11 @@ class BaseTemplateItem(Implicit, Persistent): ...@@ -691,7 +691,11 @@ class BaseTemplateItem(Implicit, Persistent):
key = stack.pop() key = stack.pop()
try: try:
value = container[key] value = container[key]
except KeyError: # AttributeError if the container changed type and is not a container
# anymore (no __getitem__ attribute).
# KeyError if the container is still a container but somehow lost the
# subobject we are trying to backup.
except (AttributeError, KeyError):
LOG('BusinessTemplate', WARNING, LOG('BusinessTemplate', WARNING,
'Could not access object %s' % (path,)) 'Could not access object %s' % (path,))
if default is _MARKER: if default is _MARKER:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment