diff --git a/product/ERP5/Tool/TemplateTool.py b/product/ERP5/Tool/TemplateTool.py index ea6160a5cc599bc2de54ef4ad09121078367d963..5138c974363ed44c4a21bae480e09947964d2355 100644 --- a/product/ERP5/Tool/TemplateTool.py +++ b/product/ERP5/Tool/TemplateTool.py @@ -134,13 +134,17 @@ class TemplateTool (BaseTool): if state == 'installed': return bt if state == 'not_installed': - last_transition = bt.workflow_history \ - ['business_template_installation_workflow'][-1] - if last_transition['action'] == 'uninstall': # There is not uninstalled state ! - t = last_transition['time'] - if last_time < t: - last_bt = None - last_time = t + try: + last_transition = bt.workflow_history \ + ['business_template_installation_workflow'][-1] + except TypeError: + continue + else: + if last_transition['action'] == 'uninstall': # There is not uninstalled state ! + t = last_transition['time'] + if last_time < t: + last_bt = None + last_time = t elif state == 'replaced' and not strict: t = bt.workflow_history \ ['business_template_installation_workflow'][-1]['time']