Commit 7600894a authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: return todestroy status when instance tree is destroyed

parent 64e0c507
service = context
item = context
portal = context.getPortalObject()
if (item.getPortalType() == 'Instance Tree') and (item.getSlapState() == "destroy_requested"):
return 'todestroy'
# If no open order, subscription must be approved
open_sale_order_movement_list = portal.portal_catalog(
portal_type=['Open Sale Order Line', 'Open Sale Order Cell'],
aggregate__uid=service.getUid(),
aggregate__uid=item.getUid(),
validation_state='validated',
limit=1
)
context.log("%s %s" % (service.getRelativeUrl(), len(open_sale_order_movement_list)))
if len(open_sale_order_movement_list) == 0:
return "not_subscribed"
......
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