Commit d9ab5bda authored by Yoshinori Okuji's avatar Yoshinori Okuji

Not proved in a unit test, but when removing items, it is safer to remove them...

Not proved in a unit test, but when removing items, it is safer to remove them in the reversed order. In fact, the previous code raises an exception, when an upgrade of a business template removes a workflow and a workflow chain related to this workflow at a time.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29054 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9011ec4c
......@@ -5020,7 +5020,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
# remove object from old business template
if len(remove_object_dict):
# XXX: this code assumes that there is an installed_bt
for item_name in installed_bt._item_name_list:
for item_name in reversed(installed_bt._item_name_list):
item = getattr(installed_bt, item_name, None)
if item is not None:
item.remove(self, remove_object_dict=remove_object_dict, trashbin=trashbin)
......
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