Ignore selection duplicates in the same field in different skin folders....

Ignore selection duplicates in the same field in different skin folders. They're likely to be overriding one another, and so the duplication is intentional and/or meaningless.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42429 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f1374f63
...@@ -55,8 +55,9 @@ ...@@ -55,8 +55,9 @@
"""\n """\n
\n \n
selection_name_dict = context.SkinsTool_getDuplicateSelectionNameDict()\n selection_name_dict = context.SkinsTool_getDuplicateSelectionNameDict()\n
for selection_name, field_list in selection_name_dict.items():\n for selection_name, field_map in selection_name_dict.items():\n
print repr(selection_name), \'\\n\\t\', \'\\n\\t\'.join(field_list)\n print repr(selection_name), \'\\n\\t\', \'\\n\\t\'.join(["%r: %s" % (field, skin_list) \n
for field, skin_list in field_map.items()])\n
return printed\n return printed\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -60,6 +60,7 @@ skins_tool = context.portal_skins\n ...@@ -60,6 +60,7 @@ skins_tool = context.portal_skins\n
selection_name_dict = {}\n 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
legacy_skin_folders = [\'erp5_simulation_legacy\']\n
\n \n
for field_path, field in skins_tool.ZopeFind(\n for field_path, field in skins_tool.ZopeFind(\n
skins_tool, obj_metatypes=[\'ProxyField\', \'ListBox\'], search_sub=1):\n skins_tool, obj_metatypes=[\'ProxyField\', \'ListBox\'], search_sub=1):\n
...@@ -83,8 +84,12 @@ for field_path, field in skins_tool.ZopeFind(\n ...@@ -83,8 +84,12 @@ 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
selection_name_dict.setdefault(\n skin_folder, field_path = field_path.split(\'/\', 1)\n
selection_name, []).append(field_path)\n if skin_folder in legacy_skin_folders:\n
# we don\'t care about selection duplication in legacy fields\n
continue\n
field_path_map = selection_name_dict.setdefault(selection_name, {})\n
field_path_map.setdefault(field_path, []).append(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
......
635 638
\ 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