Commit 895b5c4b authored by Romain Courteaud's avatar Romain Courteaud

slapos_subscription_request: allow to force the trade_condition_type when...

slapos_subscription_request: allow to force the trade_condition_type when creating a Subscription Request
parent cfa27483
...@@ -6,7 +6,7 @@ if (subscriber_person_value is None) or (subscriber_person_value.getPortalType() ...@@ -6,7 +6,7 @@ if (subscriber_person_value is None) or (subscriber_person_value.getPortalType()
source_project_value = None source_project_value = None
destination_project_value = None destination_project_value = None
trade_condition_type = None forced_trade_condition_type = trade_condition_type
if resource.getPortalType() == "Software Product": if resource.getPortalType() == "Software Product":
source_project_value = project_value source_project_value = project_value
...@@ -39,6 +39,10 @@ elif resource.getPortalType() == "Service": ...@@ -39,6 +39,10 @@ elif resource.getPortalType() == "Service":
else: else:
raise NotImplementedError('Unsupported resource: %s' % resource.getRelativeUrl()) raise NotImplementedError('Unsupported resource: %s' % resource.getRelativeUrl())
if forced_trade_condition_type is not None:
# explicit trade_condition_type was provided
trade_condition_type = forced_trade_condition_type
###################################################### ######################################################
# Find Sale Trade Condition and price # Find Sale Trade Condition and price
......
...@@ -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, default_price=None, temp_object=False, portal_type=\'Subscription Request\', item_value=None, causality_value=None</string> </value> <value> <string>subscriber_person_value, variation_category_list, project_value, currency_value=None, default_price=None, temp_object=False, portal_type=\'Subscription Request\', item_value=None, causality_value=None, trade_condition_type=None</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