Commit 4cd78ff6 authored by Romain Courteaud's avatar Romain Courteaud 🐸

slapos_subscription_request: keep subscription request causality link

parent 147560b4
......@@ -35,7 +35,7 @@ sale_packing_list_edit_kw = dict(
destination_decision_value=open_sale_order.getDestinationDecisionValue(),
destination_project_value=open_sale_order.getDestinationProjectValue(),
ledger_value=open_sale_order.getLedgerValue(),
# XXX XXX XXX XXX causality_value=subscription_request,
causality_value=causality_value,
price_currency_value=open_sale_order.getPriceCurrencyValue(),
activate_kw=activate_kw
)
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>current_date, title, activate_kw=None, REQUEST=None</string> </value>
<value> <string>current_date, title, causality_value, activate_kw=None, REQUEST=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -67,7 +67,11 @@ open_sale_order.OpenSaleOrder_archiveIfUnusedItem(check_unused_item=False)
# if we want to always activate a discount as soon as an open order is archived (outside subscription change request)
# it is needed to call OpenSaleOrderCell_createDiscountSalePackingList is an interaction workflow
# with more extra checks.
open_order_movement.OpenSaleOrderCell_createDiscountSalePackingList(current_date, 'transfer discount from %s to %s' % (open_sale_order.getReference(), next_open_sale_order.getReference()))#, activate_kw=activate_kw)
open_order_movement.OpenSaleOrderCell_createDiscountSalePackingList(
current_date,
'transfer discount from %s to %s' % (open_sale_order.getReference(), next_open_sale_order.getReference()),
subscription_change_request
)#, activate_kw=activate_kw)
# Change Subscripted Item user if needed
subscribed_item = open_order_movement.getAggregateValue(portal_type=['Instance Tree', 'Compute Node', 'Project'])
......
......@@ -130,6 +130,11 @@ open_sale_order.validate()
#######################################################
# Discount
open_order_cell.OpenSaleOrderCell_createDiscountSalePackingList(current_date, "first invoice discount for %s" % open_sale_order.getReference(), activate_kw=activate_kw)
open_order_cell.OpenSaleOrderCell_createDiscountSalePackingList(
current_date,
"first invoice discount for %s" % open_sale_order.getReference(),
subscription_request,
activate_kw=activate_kw
)
return open_sale_order
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