Commit 0b03cb0a authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_web: Replace source_project by aggregate when associate computers to support requests.

parent 737028ad
......@@ -8,7 +8,7 @@ portal = context.getPortalObject()
query = ComplexQuery(
ComplexQuery(
SimpleQuery(portal_type="Support Request"),
SimpleQuery(default_source_project_uid=context.getUid()),
SimpleQuery(default_aggregate_uid=context.getUid()),
logical_operator='and'),
ComplexQuery(
SimpleQuery(portal_type="Upgrade Decision Line"),
......
......@@ -67,6 +67,10 @@
<key> <string>columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
......@@ -272,7 +276,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(\'source_project_uid\', here.getUid())]</string> </value>
<value> <string>python: [(\'aggregate_uid\', here.getUid())]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -258,7 +258,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(\'source_project_uid\', here.getUid())]</string> </value>
<value> <string>python: [(\'aggregate_uid\', here.getUid())]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -96,6 +96,7 @@
<value>
<list>
<string>my_title</string>
<string>my_aggregate_title</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>editable</string>
<string>enabled</string>
<string>portal_type</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_aggregate_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_relation_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value>
<list>
<tuple>
<string>Hosting Subscription</string>
<string>Hosting Subscription</string>
</tuple>
<tuple>
<string>Computer</string>
<string>Computer</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Computer</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.getAggregate() is not None</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.getAggregate(portal_type=["Computer", "Hosting Subscription"]) is not None and (context.getAggregateValue().getPortalType() == "Computer" and "Related Computer" or "Related Hosting Subscription")</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -9,7 +9,7 @@ support_request = support_request_template.Base_createCloneDocument(batch_mode=1
kw = {}
if context.getPortalType() in ["Hosting Subscription", "Computer"]:
kw['source_project'] = context.getRelativeUrl()
kw['aggregate'] = context.getRelativeUrl()
support_request.edit(
title=title,
......
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