diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py index e76cc106fe80c57a8ee4ecb373ee92943af241d2..56a4f44a80c1513f60611047849b265dce5ebfe5 100644 --- a/product/ERP5/Document/BusinessTemplate.py +++ b/product/ERP5/Document/BusinessTemplate.py @@ -378,7 +378,10 @@ class BaseTemplateItem(Implicit, Persistent): if hasattr(aq_base(obj), '_filepath'): obj._filepath = None if hasattr(aq_base(obj), 'workflow_history'): - obj.workflow_history = None + if hasattr(obj.__class__, 'workflow_history'): + obj.workflow_history = None + else: + del obj.workflow_history if getattr(obj, 'meta_type', None) == 'Script (Python)': if hasattr(aq_base(obj), '_code'): obj._code = None