Commit e01b4c11 authored by Romain Courteaud's avatar Romain Courteaud

slapos_subscription_request: allow to choose the currency when creating a Subscription Request

parent f78a768b
...@@ -49,12 +49,17 @@ tmp_sale_order = module.newContent( ...@@ -49,12 +49,17 @@ tmp_sale_order = module.newContent(
source_project_value=source_project_value, source_project_value=source_project_value,
ledger_value=portal.portal_categories.ledger.automated, ledger_value=portal.portal_categories.ledger.automated,
# XXX XXX destination_project_value=instance_tree.getFollowUpValue(), # XXX XXX destination_project_value=instance_tree.getFollowUpValue(),
price_currency_value=currency_value
) )
tmp_sale_order.SaleOrder_applySaleTradeCondition(batch_mode=1, force=1) tmp_sale_order.SaleOrder_applySaleTradeCondition(batch_mode=1, force=1)
if tmp_sale_order.getSpecialise(None) is None: if tmp_sale_order.getSpecialise(None) is None:
raise AssertionError('Can not find a trade condition to generate the Subscription Request') raise AssertionError('Can not find a trade condition to generate the Subscription Request')
if currency_value is not None:
if currency_value.getRelativeUrl() != tmp_sale_order.getPriceCurrency():
raise AssertionError('Unexpected different currency: %s %s' % (currency_value.getRelativeUrl(), tmp_sale_order.getPriceCurrency()))
# If no accounting is needed, no need to check the price # If no accounting is needed, no need to check the price
if (tmp_sale_order.getSourceSection(None) == tmp_sale_order.getDestinationSection(None)) or \ if (tmp_sale_order.getSourceSection(None) == tmp_sale_order.getDestinationSection(None)) or \
(tmp_sale_order.getSourceSection(None) is None): (tmp_sale_order.getSourceSection(None) is None):
......
...@@ -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</string> </value> <value> <string>subscriber_person_value, variation_category_list, project_value, currency_value=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