Commit ebe5b46d authored by Romain Courteaud's avatar Romain Courteaud

slapos_panel: Release are now Software Product variation

parent b456f7d5
from Products.ERP5Type.Message import translateString
from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
portal = context.getPortalObject()
software_product = context
software_release = portal.software_release_module.newContent(
title='%s - %s' % (software_product.getTitle(), version),
reference=software_product.getReference(),
url_string=url_string,
url_protocol='http',
version=version,
language='en',
effective_date=effective_date,
aggregate_value=software_product,
follow_up_value=software_product.getFollowUpValue()
software_release = software_product.newContent(
portal_type="Software Product Release Variation",
title=title,
url_string=url_string
)
try:
software_release.share()
except UnsupportedWorkflowMethod:
# Agent can not share a software release
software_release.submit()
return software_release.Base_redirect(
keep_items={
'portal_status_message': translateString('New Software Release created.')
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>url_string, version, effective_date, **kw</string> </value>
<value> <string>title, url_string, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -90,9 +90,8 @@
<key> <string>left</string> </key>
<value>
<list>
<string>your_title</string>
<string>your_url_string</string>
<string>your_version</string>
<string>your_effective_date</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>default_now</string>
<string>description</string>
<string>required</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_effective_date</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>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</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>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default_now</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>The date when a document is published.</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_date_time_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Publication Date</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -10,6 +10,7 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>input_type</string>
<string>required</string>
<string>title</string>
</list>
......@@ -17,7 +18,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_version</string> </value>
<value> <string>your_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -72,13 +73,17 @@
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>input_type</string> </key>
<value> <string>url</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Version</string> </value>
<value> <string>Title</string> </value>
</item>
</dictionary>
</value>
......
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