Commit 0e2352aa authored by Jérome Perrin's avatar Jérome Perrin

equivalence tester: quick hacks for better display of divergences

parent c326166d
...@@ -86,6 +86,7 @@ class EquivalenceTesterMixin: ...@@ -86,6 +86,7 @@ class EquivalenceTesterMixin:
decision_value=decision_value, decision_value=decision_value,
prevision_value=prevision_value, prevision_value=prevision_value,
tested_property=self.getTestedProperty(), tested_property=self.getTestedProperty(),
tested_property_title=self.getTestedPropertyTitle(),
tester_relative_url=self.getRelativeUrl(), tester_relative_url=self.getRelativeUrl(),
message=message, message=message,
mapping=mapping mapping=mapping
...@@ -173,15 +174,15 @@ class EquivalenceTesterMixin: ...@@ -173,15 +174,15 @@ class EquivalenceTesterMixin:
return None return None
# XXX explanation message should be provided by each class, each # XXX explanation message should be provided by each class, each
# portal type or each document. # portal type or each document.
message = '<a href="${decision_url}">${property_name} of ${decision_value} of ${decision_type} ${decision_title}</a> of <a href="${delivery_url}">${delivery_title}</a> is different from <a href="${prevision_url}">planned ${property_name} of ${prevision_value}</a>.' message = '<a href="${decision_url}">${property_name} of ${decision_value} of ${decision_type} ${decision_title}</a><br/>' \
'of <a href="${delivery_url}">${delivery_title}</a><br/>' \
'is different from <a href="${prevision_url}">planned ${property_name} of ${prevision_value}</a>.'
decision_movement = self.getPortalObject().unrestrictedTraverse( decision_movement = self.getPortalObject().unrestrictedTraverse(
divergence_message.getProperty('object_relative_url')) divergence_message.getProperty('object_relative_url'))
decision_delivery = decision_movement.getRootDeliveryValue() decision_delivery = decision_movement.getRootDeliveryValue()
mapping = { mapping = {
'decision_url':decision_movement.absolute_url(), 'decision_url':decision_movement.absolute_url(),
# TODO we need a way to map the property name to the business word, 'property_name':divergence_message.getProperty('tested_property_title') or divergence_message.getProperty('tested_property'),
# eg. 'start_date' to 'Delivery Date' for trade etc.
'property_name':divergence_message.getProperty('tested_property'),
'decision_value':h(divergence_message.getProperty('decision_value')), 'decision_value':h(divergence_message.getProperty('decision_value')),
'decision_type':decision_movement.getPortalType(), 'decision_type':decision_movement.getPortalType(),
'decision_title':h(decision_movement.getTitleOrId()), 'decision_title':h(decision_movement.getTitleOrId()),
......
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