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

slapos_accounting: search the trade condition with searchPredicateList

parent de7c6944
...@@ -2,7 +2,6 @@ portal = context.getPortalObject() ...@@ -2,7 +2,6 @@ portal = context.getPortalObject()
portal.portal_catalog.searchAndActivate( portal.portal_catalog.searchAndActivate(
method_id='InstanceTree_requestUpdateOpenSaleOrder', method_id='InstanceTree_requestUpdateOpenSaleOrder',
method_kw=dict(specialise="sale_trade_condition_module/default_subscription_trade_condition", ),
portal_type="Instance Tree", portal_type="Instance Tree",
causality_state="diverged", causality_state="diverged",
activate_kw={'tag': tag, 'priority': 2}, activate_kw={'tag': tag, 'priority': 2},
......
...@@ -115,6 +115,13 @@ if instance_tree.getCausalityState() == 'diverged': ...@@ -115,6 +115,13 @@ if instance_tree.getCausalityState() == 'diverged':
**edit_kw **edit_kw
) )
open_order = open_order_line.getParentValue()
open_order.SaleOrder_applySaleTradeCondition(batch_mode=1, force=1)
# Check compatibility with previous template
if specialise is not None:
assert open_order.getSpecialise() == specialise
predicate_list = [] predicate_list = []
inherited_trade_condition = open_sale_order.getSpecialiseValue() inherited_trade_condition = open_sale_order.getSpecialiseValue()
while inherited_trade_condition is not None: while inherited_trade_condition is not None:
...@@ -141,12 +148,6 @@ if instance_tree.getCausalityState() == 'diverged': ...@@ -141,12 +148,6 @@ if instance_tree.getCausalityState() == 'diverged':
storeWorkflowComment(open_sale_order, open_order_explanation) storeWorkflowComment(open_sale_order, open_order_explanation)
open_order = open_order_line.getParentValue()
open_order.SaleOrder_applySaleTradeCondition(batch_mode=1, force=1)
# Check compatibility with previous template
assert open_order.getSpecialise() == specialise
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()
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>specialise, REQUEST=None</string> </value> <value> <string>specialise=None, REQUEST=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