Commit e1be838d authored by Nicolas Dumazet's avatar Nicolas Dumazet

only do cleanups at export time: examining interfaces when importing a bt is harmful as it

forces us to load the object very early (before build, before install)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38600 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2dfe75ca
...@@ -598,6 +598,11 @@ class BaseTemplateItem(Implicit, Persistent): ...@@ -598,6 +598,11 @@ class BaseTemplateItem(Implicit, Persistent):
#'Z SQL Method': ('_arg', 'template',), #'Z SQL Method': ('_arg', 'template',),
}.get(meta_type, ())) }.get(meta_type, ()))
if interfaces.IIdGenerator.providedBy(obj):
for dict_name in ('last_max_id_dict', 'last_id_dict'):
if getattr(obj, dict_name, None) is not None:
delattr(obj, dict_name)
for attr in obj.__dict__.keys(): for attr in obj.__dict__.keys():
if attr in attr_set or attr.startswith('_cache_cookie_'): if attr in attr_set or attr.startswith('_cache_cookie_'):
delattr(obj, attr) delattr(obj, attr)
...@@ -613,10 +618,6 @@ class BaseTemplateItem(Implicit, Persistent): ...@@ -613,10 +618,6 @@ class BaseTemplateItem(Implicit, Persistent):
else: else:
# save result of automatic compilation # save result of automatic compilation
obj._p_changed = 1 obj._p_changed = 1
elif interfaces.IIdGenerator.providedBy(obj):
for dict_name in ('last_max_id_dict', 'last_id_dict'):
if getattr(obj, dict_name, None) is not None:
delattr(obj, dict_name)
return obj return obj
def getTemplateTypeName(self): def getTemplateTypeName(self):
......
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