Commit d15e9d4e authored by Romain Courteaud's avatar Romain Courteaud

ERP5Form: show more related proxy fields

parent 25e0fd0d
......@@ -850,7 +850,8 @@ class ERP5Form(Base, ZMIForm, ZopePageTemplate):
skins_tool = self.portal_skins
folder_id = self.aq_parent.id
for skin_folder_id in self.getSimilarSkinFolderIdList():
# for skin_folder_id in self.getSimilarSkinFolderIdList():
for skin_folder_id in self.getPortalObject().portal_skins.objectIds():
iterate(getattr(skins_tool, skin_folder_id))
iterate(skins_tool.erp5_core)
return form_list
......@@ -1017,11 +1018,10 @@ class ERP5Form(Base, ZMIForm, ZopePageTemplate):
form_id = self.id
proxy_dict = {}
for document in self.objectValues():
if document.meta_type == 'ProxyField':
short_path = "%s.%s" % (form_id, document.id)
proxy_dict[short_path] = {'proxy': document,
'short_path': short_path,
'related_proxy_list': []}
short_path = "%s.%s" % (form_id, document.id)
proxy_dict[short_path] = {'proxy': document,
'short_path': short_path,
'related_proxy_list': []}
def iterate(document):
for i in document.objectValues():
if i.meta_type == 'ERP5 Form':
......@@ -1040,7 +1040,8 @@ class ERP5Form(Base, ZMIForm, ZopePageTemplate):
skins_tool = self.portal_skins
proxy_dict_list = []
if len(proxy_dict):
for skin_folder_id in self.getSimilarSkinFolderIdList():
# for skin_folder_id in self.getSimilarSkinFolderIdList():
for skin_folder_id in self.getPortalObject().portal_skins.objectIds():
iterate(getattr(skins_tool, skin_folder_id))
proxy_dict_list = proxy_dict.values()
proxy_dict_list.sort(key=lambda x: x['short_path'])
......
  • @romain @seb what's the reason behind this ?

  • This functionnality was only showing related proxy field from the same bt5. I changed it to show all related proxy defined in portal_skins.

  • In short: when changing one field from a field library, I want to see how this will impact all forms installed on the site.

  • Thanks for the clarification, I understand.

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