Commit 06ca688e authored by Romain Courteaud's avatar Romain Courteaud

slapos_subscription_request: allow to check if creating a subscription request is possible

parent 4395808d
...@@ -99,6 +99,7 @@ else: ...@@ -99,6 +99,7 @@ else:
subscription_request = portal.subscription_request_module.newContent( subscription_request = portal.subscription_request_module.newContent(
portal_type='Subscription Request', portal_type='Subscription Request',
temp_object=temp_object,
source_value=subscriber_person_value, source_value=subscriber_person_value,
source_section_value=source_section, source_section_value=source_section,
source_decision_value=subscriber_person_value, source_decision_value=subscriber_person_value,
...@@ -119,9 +120,13 @@ subscription_request = portal.subscription_request_module.newContent( ...@@ -119,9 +120,13 @@ subscription_request = portal.subscription_request_module.newContent(
price=price, price=price,
# XXX activate_kw=activate_kw # XXX activate_kw=activate_kw
) )
if temp_object:
subscription_request.edit(reference="foo")
if len(subscription_request.checkConsistency()) != 0: if len(subscription_request.checkConsistency()) != 0:
raise AssertionError(subscription_request.checkConsistency()) raise AssertionError(subscription_request.checkConsistency())
subscription_request.submit() if not temp_object:
subscription_request.submit()
return subscription_request return subscription_request
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>subscriber_person_value, variation_category_list, project_value, currency_value=None</string> </value> <value> <string>subscriber_person_value, variation_category_list, project_value, currency_value=None, temp_object=False</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
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