Commit 9f2e9559 authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: experiment new trade condition

parent a3056e04
...@@ -22,11 +22,10 @@ def storeWorkflowComment(document, comment): ...@@ -22,11 +22,10 @@ def storeWorkflowComment(document, comment):
def newOpenOrder(): def newOpenOrder():
new_open_sale_order = portal.open_sale_order_module.newContent( new_open_sale_order = portal.open_sale_order_module.newContent(
portal_type="Open Sale Order", portal_type="Open Sale Order",
specialise="sale_trade_condition_module/slapos_subscription_trade_condition", # XXX HARDCODED
specialise=specialise,
effective_date=DateTime(), effective_date=DateTime(),
activate_kw=activate_kw, activate_kw=activate_kw,
#source=open_sale_order_template.getSource(),
#source_section=open_sale_order_template.getSourceSection(),
destination=person.getRelativeUrl(), destination=person.getRelativeUrl(),
destination_decision=person.getRelativeUrl(), destination_decision=person.getRelativeUrl(),
title="%s SlapOS Subscription" % person.getTitle() title="%s SlapOS Subscription" % person.getTitle()
...@@ -125,13 +124,14 @@ if instance_tree.getCausalityState() == 'diverged': ...@@ -125,13 +124,14 @@ if instance_tree.getCausalityState() == 'diverged':
if open_order_line is not None: if open_order_line is not None:
open_order = open_order_line.getParentValue() open_order = open_order_line.getParentValue()
open_order.SaleOrder_applySaleTradeCondition(batch_mode=1)
# Check compatibility with previous template # Check compatibility with previous template
assert open_order.getSourceSection() == 'organisation_module/slapos' assert open_order.getSourceSection() == 'organisation_module/slapos'
assert open_order.getDestinationSection() == 'organisation_module/slapos' assert open_order.getDestinationSection() == 'organisation_module/slapos'
assert open_order.getSource() == 'organisation_module/slapos' assert open_order.getSource() == 'organisation_module/slapos'
assert open_order.getPriceCurrency() == 'currency_module/EUR' assert open_order.getPriceCurrency() == 'currency_module/EUR'
assert open_order.getSpecialise() == 'sale_trade_condition_module/slapos_subscription_trade_condition' assert open_order.getSpecialise() == specialise
assert open_order_line.getResource() == 'service_module/slapos_instance_subscription' assert open_order_line.getResource() == 'service_module/slapos_instance_subscription'
assert open_order_line.getQuantityUnit() == 'unit/piece' assert open_order_line.getQuantityUnit() == 'unit/piece'
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>REQUEST=None</string> </value> <value> <string>specialise="sale_trade_condition_module/couscous_trade_condition", REQUEST=None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
currency_module/CNY currency_module/CNY
currency_module/EUR currency_module/EUR
sale_trade_condition_module/couscous_trade_condition
sale_trade_condition_module/slapos_aggregated_consumption_trade_condition sale_trade_condition_module/slapos_aggregated_consumption_trade_condition
sale_trade_condition_module/slapos_aggregated_consumption_trade_condition/** sale_trade_condition_module/slapos_aggregated_consumption_trade_condition/**
sale_trade_condition_module/slapos_aggregated_subscription_trade_condition sale_trade_condition_module/slapos_aggregated_subscription_trade_condition
......
...@@ -72,6 +72,7 @@ portal_solvers/Automatic Quantity Adopt Solver/** ...@@ -72,6 +72,7 @@ portal_solvers/Automatic Quantity Adopt Solver/**
sale_packing_list_module/slapos_accounting_instance_delivery_line_template sale_packing_list_module/slapos_accounting_instance_delivery_line_template
sale_packing_list_module/slapos_accounting_instance_delivery_line_template/** sale_packing_list_module/slapos_accounting_instance_delivery_line_template/**
sale_packing_list_module/slapos_accounting_instance_delivery_template sale_packing_list_module/slapos_accounting_instance_delivery_template
sale_trade_condition_module/couscous_trade_condition
sale_trade_condition_module/slapos_aggregated_consumption_trade_condition sale_trade_condition_module/slapos_aggregated_consumption_trade_condition
sale_trade_condition_module/slapos_aggregated_consumption_trade_condition/** sale_trade_condition_module/slapos_aggregated_consumption_trade_condition/**
sale_trade_condition_module/slapos_aggregated_subscription_trade_condition sale_trade_condition_module/slapos_aggregated_subscription_trade_condition
......
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