Commit 3ce730a0 authored by Romain Courteaud's avatar Romain Courteaud

slapos_panel: require currency information when creating a virtual master

parent e01b4c11
......@@ -11,8 +11,10 @@ project = portal.project_module.newContent(
)
project.validate()
currency_value = portal.restrictedTraverse(price_currency)
# create the subscription request, which will lead to the Open Order
subscription_request = resource.Resource_createSubscriptionRequest(customer, [], project)
subscription_request = resource.Resource_createSubscriptionRequest(customer, [], project, currency_value=currency_value)
# XXX How to specify the trade condition containing the currency and trade model lines?
specialise_value = subscription_request.getSpecialiseValue(portal_type="Sale Trade Condition")
......@@ -53,6 +55,7 @@ sale_trade_condition = portal.sale_trade_condition_module.newContent(
source_value=subscription_request.getDestinationValue(),
source_section_value=source_section_value,
#source_payment_value=seller_bank_account,
price_currency_value=currency_value
)
sale_trade_condition.validate()
......@@ -71,6 +74,7 @@ sale_trade_condition = portal.sale_trade_condition_module.newContent(
source_value=subscription_request.getDestinationValue(),
source_section_value=source_section_value,
#source_payment_value=seller_bank_account,
price_currency_value=currency_value
)
sale_trade_condition.validate()
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>title, is_compute_node_payable , is_instance_tree_payable, batch=0, **kw</string> </value>
<value> <string>title, is_compute_node_payable , is_instance_tree_payable, price_currency, batch=0, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -102,6 +102,7 @@
<value>
<list>
<string>your_title</string>
<string>your_price_currency</string>
<string>your_is_compute_node_payable</string>
<string>your_is_instance_tree_payable</string>
</list>
......
<?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>items</string>
<string>required</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_price_currency</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>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_dialog_mode_category</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Currency</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:here.CurrencyModule_getCurrencyItemList()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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