Commit c8acd609 authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: do not crash if open order line is not linked to an instance

parent c7922f3a
......@@ -58,8 +58,10 @@ if open_sale_order.getValidationState() == 'validated':
hosting_subscription = open_order_line.getAggregateValue(portal_type='Hosting Subscription')
instance_tree = open_order_line.getAggregateValue(portal_type='Instance Tree')
assert current_start_date == hosting_subscription.HostingSubscription_calculateSubscriptionStartDate()
if instance_tree is not None:
subscription_request = instance_tree.getAggregateRelatedValue(portal_type="Subscription Request")
# Define the start date of the period, this can variates with the time.
next_stop_date_delta = 0
......
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