Commit d0ad6130 authored by Romain Courteaud's avatar Romain Courteaud

[romain_dev] wip tools

parent 70560838
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Image" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>0902777a614513139cc299ba6f1c4e9c</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/png</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>grumpy.png</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>filename</string> </key>
<value> <string>30251-grumpy-cat-1920x1200-meme-wallpaper.jpg.png</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>1200</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>romain_wallpaper_grumpy</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Image</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Grumpy wallpaper</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>1920</int> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</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="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</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>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAc=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1567673769.31</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="7" aka="AAAAAAAAAAc=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.16649.15269.28774</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1567765047.39</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>business_template_skin_layer_priority</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>float</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>51.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>romain_dev</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5_update_catalog_list = ('erp5_ingestion_mysql_innodb_catalog', 'erp5_full_text_mroonga_catalog')
bt5_installation_list = bt5_update_catalog_list + ('erp5_xhtml_style',
# 'erp5_officejs', 'erp5_web_jabber_client',
# 'erp5_officejs_ooffice',
'erp5_upgrader',
'erp5_hal_json_style',
# 'erp5_ods_style',
# 'erp5_officejs_ui_test',
# 'erp5_crm_renderjs_ui_test',
# 'erp5_trade_renderjs_ui_test',
'erp5_web_renderjs_ui_test',
# 'erp5_pdm_renderjs_ui_test',
# 'erp5_accounting_renderjs_ui_test',
# 'erp5_officejs_ui_test',
# 'erp5_officejs_support_request_ui_test',
# 'erp5_calendar',
# 'erp5_crm',
# 'erp5_mrp',
# 'erp5_project',
# test dependencies
# 'erp5_configurator_standard_trade_template',
# 'erp5_simulation_test',
# 'erp5_accounting',
# 'erp5_monaco_editor_ui_test',
# 'erp5_gadget_interface_validator_ui_test',
'erp5_forge',
# 'erp5_web_jabber_client',
'erp5_web_ui_test',
'erp5_officejs_afs_directory_ui_test',
# 'erp5_travel_expense', 'erp5_travel_expense_ui_test',
# 'officejs_olapy_demo', 'erp5_officejs_connector'
# 'erp5_discussion'
)
return bt5_installation_list, []
<?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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getUpgradeBusinessTemplateList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
portal = portal = context.getPortalObject()
module_business_application_map = {'base': ('currency_module',
'organisation_module',
'person_module',),
'accounting': ('accounting_module',
'account_module',),
'forge': ('bug_module', 'glossary_module', 'test_result_module', 'test_suite_module'),
'dev': ('foo_module', 'bar_module', 'foo_bar_module'),
'project': ('project_module', 'task_module', 'task_report_module'),
'crm': ('campaign_module',
'event_module',
'meeting_module',
'sale_opportunity_module',
'support_request_module',),
'dms': ('document_module',
'image_module',
'document_ingestion_module',
'web_page_module',),
'trade': ('internal_packing_list_module',
'inventory_module',
'purchase_order_module',
'purchase_packing_list_module',
'purchase_trade_condition_module',
'returned_sale_packing_list_module',
'sale_order_module',
'sale_packing_list_module',
'sale_trade_condition_module'),
'pdm': ('component_module',
'product_module',
'purchase_supply_module',
'sale_supply_module',
'service_module',
'transformation_module',),
}
for business_application_category_id, module_ids in module_business_application_map.items():
for module_id in module_ids:
module = getattr(portal, module_id, None)
if module is not None:
module.edit(business_application = business_application_category_id)
return 'ok'
<?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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_setupModuleList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
domain_list = [] # [<Temporary Domain at /erp5/portal_domains/my_module_domain/sub_domain>, ...]
##### Get parents' criterions ######
parents_criterion_dict = {} # {"portal_type": {"identity": ["Task Report"]}), ...}
parents_membership_criterion_category_set = set() # ["follow_up/project_module/xxx", ...]
sub_parent = parent
while depth > 0:
for criterion in sub_parent.getCriterionList():
property_id = criterion.property
if property_id not in parents_criterion_dict:
parents_criterion_dict[property_id] = {"min": criterion.min, "max": criterion.max, "identity": criterion.identity}
sub_parent_membership_criterion_category_list = sub_parent.getMembershipCriterionCategoryList()
# sub_parent.getMultimembershipCriterionBaseCategoryList() seems to return empty list...
parents_membership_criterion_category_set.update(sub_parent_membership_criterion_category_list)
depth -= 1
sub_parent = sub_parent.getParentValue()
##### Define domain_list.append helper #####
def appendNewTempDomain(id, criterion_dict=None, membership_criterion_category_list=None, **kw):
if criterion_dict is None:
criterion_dict = parents_criterion_dict
else:
criterion_dict.update(parents_criterion_dict)
if membership_criterion_category_list is None:
membership_criterion_category_list = list(parents_membership_criterion_category_set)
else:
membership_criterion_category_list = list(parents_membership_criterion_category_set.union(membership_criterion_category_list))
multimembership_criterion_base_category_list = list(set([c[:c.index("/")] for c in membership_criterion_category_list]))
domain = parent.generateTempDomain(id=id)
domain.edit(
criterion_property_list=criterion_dict.keys(),
multimembership_criterion_base_category_list=multimembership_criterion_base_category_list,
membership_criterion_category_list=membership_criterion_category_list,
domain_generator_method_id=script.id,
**kw
)
for property_id, criterion_kw in criterion_dict.items():
domain.setCriterion(property_id, **criterion_kw)
domain_list.append(domain)
##### Provide sub domains #####
# Don't define domain that provides criterions already used by parents
if "delivery.start_date" not in parents_criterion_dict:
now = DateTime()
for time_frame in (1, 7, 30, 365):
appendNewTempDomain(
id="sub_time_frame_{}".format(time_frame),
title="Last {} days".format(time_frame),
criterion_dict={"delivery.start_date": {"min": now - time_frame}},
)
person = context.getPortalObject().portal_membership.getAuthenticatedMember().getUserValue()
if person is not None:
category_relative_url = "source/" + person.getRelativeUrl()
if category_relative_url not in parents_membership_criterion_category_set:
appendNewTempDomain(
id="sub_assigned_to_me_1",
title="Assigned to me",
membership_criterion_category_list=(category_relative_url,),
)
return domain_list
<?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>parent, depth</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>generateTristanDomain</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>getObjectByOid</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>test_kaz</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>getObjectByOid</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
# you can pass oid like "?oid=0x123456"
if oid.startswith('0x'):
oid = ('\x00'*8 + oid[2:].decode('hex'))[-8:]
ob = context.getObjectByOid(oid)
print repr(ob)[:10*1024]
return printed
<?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>oid</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>printObjectByOid</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>testrc</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>testrc</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testrc</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>testrc</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
context.getPortalObject().notebook_module.olapy_notebook.edit(title="olapy_notebook.jsmd", reference="olapy_notebook.jsmd")
return "ok"
import time
time.sleep(360)
return 'cosucous'
portal_object = portal = context.getPortalObject()
module = portal.person_module
i = 0
while i < 80000:
module.newContent(portal_type='Person', title='test %i' % i)
i += 1
return 'couscous'
context.portal_catalog.searchAndActivate(
portal_type='Person',
parent_uid=context.getUid(),
method_id='testromain2'
)
return 'ok'
return 'ok'
from DateTime import DateTime
portal = context.getPortalObject()
token = portal.access_token_module.newContent(
id='%s-%s' % (DateTime().strftime('%Y%m%d'), portal.Base_generateAccessTokenHalID()),
portal_type='HAL Access Token',
agent='person_module/160295'
)
token.validate()
return token.getRelativeUrl()
from DateTime import DateTime
i = 0
while i < 700:
context.newContent(
portal_type='Test Result Line',
string_index=i,
title=i,
start_date=DateTime(),
duration=i,
all_tests=i,
errors=1,
failures=2,
skip=3,
)
i += 1
return 'ok'
context.portal_catalog.searchAndActivate(
portal_type='Person',
parent_uid=context.getUid(),
method_id='testromain2'
)
return 'ok'
context.portal_catalog.searchAndActivate(
portal_type='Person',
parent_uid=context.getUid(),
method_id='testromain2'
)
return 'ok'
return 'ok'
# python: here.Module_listWorkflowTransitionItemList()['form_id_dict'].get(request.get("field_your_mass_workflow_action", ""), '')
result = None
form_id_dict = context.Module_listWorkflowTransitionItemList()['form_id_dict']
# During rendering, this variable has been set into the request
# Render what user selected
action = request.get("mass_workflow_action", "")
if action:
return form_id_dict.get(action, '')
# Validate only if user didn't change the possible action
action = request.get("field_your_mass_workflow_action", "")
if (action and action == request.get("field_your_previous_mass_workflow_action", "")):
return form_id_dict.get(action, '')
return ''
portal_object = portal = context.getPortalObject()
module = portal.foo_module
i = 0
while i < 80000:
module.newContent(portal_type='Foo', title='test %i' % i)
i += 1
return 'couscous'
raise NotImplementedError(context.REQUEST)
return '%s %s %s %s' % (portal.portal_url(), portal.absolute_url(), portal.absolute_url_path(), context.REQUEST.physicalPathToURL(portal.getPhysicalPath() + ("",)))
return portal_object.portal_preferences.getPreference('preferred_foo_use', None)
domain_tool = portal_object.portal_domains
base_domain = domain_tool.foo_domain
url_domain = portal_object.portal_url
def generateRecur(domain, depth, result_list):
if depth:
result_list.append(('/'.join(url_domain.getRelativeContentPath(domain)[2:]), domain.getTitle()))
new_depth = depth + 1
for sub_domain in domain_tool.getChildDomainValueList(domain, depth=depth):
generateRecur(sub_domain, new_depth, result_list)
value_list = []
generateRecur(base_domain, 0, value_list)
print value_list
value_list = []
print value_list
return printed
def getDomainSelection(domain_list):
root_dict = {}
if len(domain_list) > 0:
category_tool = portal.portal_categories
domain_tool = portal.portal_domains
preference_tool = portal.portal_preferences
for base_domain_id in domain_list:
domain = None
if category_tool is not None:
domain = category_tool.restrictedTraverse(base_domain_id, None)
if domain is not None :
root_dict[base_domain_id] = getattr(
domain,
preference_tool.getPreference(
'preferred_category_child_item_list_method_id',
'getCategoryChildCompactLogicalPathItemList'
)
)(local_sort_id=('int_index', 'translated_title'), checked_permission='View',
filter_node=0, display_none_category=0)
elif domain_tool is not None:
try:
domain = domain_tool.getDomainByPath(base_domain_id, None)
except KeyError:
domain = None
if domain is not None:
# XXX Implement recursive fetch
root_dict[base_domain_id] = [(x.getTitle(), x.getId()) for x in domain_tool.getChildDomainValueList(domain, depth=0)]
return root_dict
return getDomainSelection(['foo_domain'])
return portal_object.portal_catalog(selection_domain={'region': 'france'}, src__=1)
return portal_object.portal_catalog(selection_domain={'region': portal_object.portal_categories.region.france}, src__=1)
domain = portal_object.portal_domains.getDomainByPath('validated_project_domain')
sql_catalog = portal_object.portal_catalog.getSQLCatalog()
return portal_object.portal_catalog(src__=1, full_text='title:"nutnut" AND validated_project_domain:"sub1" AND selection_domain:"region:france"')
query_kw = dict(selection_domain={
'validated_project_domain': domain.getChildDomainValueList(domain, depth=0)[0],
'region': portal_object.portal_categories.region.france
})
return sql_catalog.buildQuery(query_kw).asSearchTextExpression(sql_catalog)
return portal_object.portal_catalog(src__=1, **query_kw)
return portal_object.portal_catalog(selection_domain={'region': portal_object.portal_categories.region.france}, src__=1)
from Products.ERP5Form.Selection import Selection, DomainSelection
def getDomainSelection(self, domain_list):
"""Return a DomainSelection object wrapped with the context.
"""
portal_object = self.getPortalObject()
root_dict = {}
if len(domain_list) > 0:
category_tool = portal_object.portal_categories
domain_tool = portal_object.portal_domains
preference_tool = portal_object.portal_preferences
for domain in domain_list:
root = None
base_domain = domain.split('/', 1)[0]
if category_tool is not None:
root = category_tool.restrictedTraverse(domain, None)
if root is not None :
root_dict[base_domain] = getattr(
root,
preference_tool.getPreference(
'preferred_category_child_item_list_method_id',
'getCategoryChildCompactLogicalPathItemList'
)
)(local_sort_id=('int_index', 'translated_title'), checked_permission='View',
filter_node=0, display_none_category=0)
elif domain_tool is not None:
try:
root = domain_tool.getDomainByPath(domain, None)
except KeyError:
root = None
if root is not None:
root_dict[base_domain] = [(x.getTitle(), x.getId()) for x in root.getChildDomainValueList(root, depth=0)]
if root is None:
root = portal_object.restrictedTraverse(domain, None)
if root is not None:
root_dict[None] = (None, domain)
return root_dict
# return DomainSelection(domain_dict = root_dict)#.__of__(self.getContext())
return getDomainSelection(context, ['parent', 'region', 'validated_project_domain', 'preferred_group_person_list_domain', 'ledger'])#.asDomainItemDict(portal=context.getPortalObject())
return context.getPortalObject().TaskModule_viewTaskList.listbox.getDomainSelection()
# from Products.ERP5Form.Tool.SelectionTool import makeTreeList
# return makeTreeList()
# return context.getPortalObject().portal_selections.
return context.getPortalObject().portal_catalog(selection_domain={'group': context}, src__=1)
return "couscous"
context.setContentType(None)
context.edit(content_type=None)
# delete content.content_type
return "ok"
# Example code:
# Import a standard function, and get the HTML request and response objects.
from Products.PythonScripts.standard import html_quote
request = container.REQUEST
response = request.response
# Return a string identifying this script.
print "This is the", script.meta_type, '"%s"' % script.getId(),
if script.title:
print "(%s)" % html_quote(script.title),
print "in", container.absolute_url()
return printed
<?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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testromain</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
erp5_web_renderjs_ui
erp5_upgrader
\ No newline at end of file
1
\ No newline at end of file
image_module/romain_wallpaper_*
\ No newline at end of file
image_module/romain_wallpaper_*
\ No newline at end of file
image_module/romain_wallpaper_*
\ No newline at end of file
romain_dev
\ No newline at end of file
romain_dev
\ No newline at end of file
0.1
\ 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