Commit 3265441c authored by Romain Courteaud's avatar Romain Courteaud

[erp5_crm] Drop ticket_use_domain

Domains are not meant to display too many documents at the same level.
parent 6a3a7cf9
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Base Domain" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>domain_generator_method_id</string> </key>
<value> <string>Base_generateTicketUseDomain</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ticket_use_domain</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Base Domain</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Ticket Use Domain</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
portal = context.getPortalObject()
if depth:
category_relative_url = parent.getMembershipCriterionCategory()
else:
category_relative_url = portal.portal_preferences.getPreference(
'preferred_' + context.REQUEST['here'].getPortalType().replace(' Module', '').lower().replace(' ', '_') + '_use',
)
if not category_relative_url:
return ()
child_list, resource_list = portal.portal_categories.use.restrictedTraverse(category_relative_url).Category_getUseCategoryListAndResourceList()
domain_list = []
if child_list:
resource_uid_by_use_uid_dict = {}
for row in portal.portal_catalog(select_list=['default_use_uid'], default_use_uid=[x.getUid() for x in child_list]):
resource_uid_by_use_uid_dict.setdefault(row.default_use_uid, []).append(row.uid)
for child in child_list:
domain = parent.generateTempDomain(id=child.getId())
domain.edit(
title=child.getTranslatedTitle(),
membership_criterion_category=(child.getRelativeUrl(), ),
domain_generator_method_id=script.id,
)
domain.setCriterionPropertyList(['strict_resource_uid'])
domain.setCriterion('strict_resource_uid', identity=resource_uid_by_use_uid_dict[child.getUid()])
domain_list.append(domain)
for resource in resource_list:
domain = parent.generateTempDomain(id=resource.getId())
domain.edit(
title=resource.getTranslatedTitle(),
membership_criterion_base_category=('resource', ),
membership_criterion_category=('resource/' + resource.getRelativeUrl(), ),
)
domain_list.append(domain)
return sorted(domain_list, key=lambda x: x.getTitle())
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>depth, parent</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_generateTicketUseDomain</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -224,17 +224,12 @@
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>ticket_use_domain</string>
<string>Type</string>
</tuple>
</list>
<list/>
</value>
</item>
<item>
<key> <string>domain_tree</string> </key>
<value> <int>1</int> </value>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>editable_columns</string> </key>
......
......@@ -218,10 +218,6 @@
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>ticket_use_domain</string>
<string>Type</string>
</tuple>
<tuple>
<string>causality_event_portal_type_domain</string>
<string>Channel</string>
......
portal_alarms/upgrader_migrate_event_workflow_history
portal_contribution_registry/crm_ingestion
portal_domains/causality_event_portal_type_domain
portal_domains/communication_plan_domain
portal_domains/ticket_use_domain
\ No newline at end of file
portal_domains/communication_plan_domain
\ 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