Commit b805970b authored by Jérome Perrin's avatar Jérome Perrin

SkinsTool_getDuplicateSelectionNameDict: do the check for each skin selection

This is mostly to avoid problems with proxy fields not finding their template field in default skin selection
parent 3e16a161
...@@ -61,8 +61,11 @@ selection_name_dict = {}\n ...@@ -61,8 +61,11 @@ selection_name_dict = {}\n
\n \n
ok_to_share_selection_form_list = [\'Resource_viewInventory\', \'Resource_viewMovementHistory\']\n ok_to_share_selection_form_list = [\'Resource_viewInventory\', \'Resource_viewMovementHistory\']\n
\n \n
for field_path, field in skins_tool.ZopeFind(\n for skin_name, skin_path_list in skins_tool.getSkinPaths():\n
skins_tool, obj_metatypes=[\'ProxyField\', \'ListBox\'], search_sub=1):\n skins_tool.changeSkin(skin_name)\n
for skin_folder in skin_path_list.split(\',\'):\n
for field_path, field in skins_tool.ZopeFind(\n
skins_tool[skin_folder], obj_metatypes=[\'ProxyField\', \'ListBox\'], search_sub=1):\n
form = field.aq_parent\n form = field.aq_parent\n
# in some rare cases sharing a selection can be done intentional so avoid them\n # in some rare cases sharing a selection can be done intentional so avoid them\n
if form.getId() in ok_to_share_selection_form_list:\n if form.getId() in ok_to_share_selection_form_list:\n
...@@ -83,9 +86,8 @@ for field_path, field in skins_tool.ZopeFind(\n ...@@ -83,9 +86,8 @@ for field_path, field in skins_tool.ZopeFind(\n
selection_name = field.get_orig_value(\'selection_name\')\n selection_name = field.get_orig_value(\'selection_name\')\n
if selection_name == \'\':\n if selection_name == \'\':\n
continue\n continue\n
skin_folder, field_path = field_path.split(\'/\', 1)\n
field_path_map = selection_name_dict.setdefault(selection_name, {})\n field_path_map = selection_name_dict.setdefault(selection_name, {})\n
field_path_map.setdefault(field_path, []).append(skin_folder)\n field_path_map.setdefault(field_path, set()).add(skin_folder)\n
\n \n
# leave only duplicating ones\n # leave only duplicating ones\n
duplicating_selection_name_dict = {}\n duplicating_selection_name_dict = {}\n
......
680 681
\ No newline at end of file \ No newline at end of file
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