Commit df7a9f95 authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: debug debug debug log log log

parent 018f5e61
......@@ -123,6 +123,7 @@ if instance_tree.getCausalityState() == 'diverged':
assert open_order.getSpecialise() == specialise
predicate_list = []
log_predicate_list = []
inherited_trade_condition = open_sale_order.getSpecialiseValue()
if specialise is None:
......@@ -133,6 +134,9 @@ if instance_tree.getCausalityState() == 'diverged':
x for x in inherited_trade_condition.contentValues(portal_type='Sale Supply Line')
if x.getResource() == service.getRelativeUrl()
])
log_predicate_list.extend([
x for x in inherited_trade_condition.contentValues(portal_type='Sale Supply Line')
])
inherited_trade_condition = inherited_trade_condition.getSpecialiseValue(portal_type=inherited_trade_condition.getPortalType())
price = service.getPrice(
......@@ -141,11 +145,13 @@ if instance_tree.getCausalityState() == 'diverged':
default=None,
)
if price is None:
raise NotImplementedError('Price not found on %s (%s) for %s %s' % (
raise NotImplementedError('Price not found on %s (%s) for %s %s - %s' % (
open_sale_order.getSpecialiseTitle(),
open_sale_order.getSpecialise(),
service.getRelativeUrl(),
str([x.getRelativeUrl() for x in predicate_list])))
str([x.getRelativeUrl() for x in predicate_list]),
str([(x.getRelativeUrl(), x.getResource()) for x in log_predicate_list]),
))
open_order_line.edit(
price=price
)
......
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