Commit 2c5c8c01 authored by Łukasz Nowak's avatar Łukasz Nowak

- updated copyrights

 - added more explanation to class docstring, add method docstrings
 - added note about simplification
 - removed not needed variable


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28459 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f6a7f159
##############################################################################
#
# Copyright (c) 2008 Nexedi SA and Contributors. All Rights Reserved.
# Copyright (c) 2008-2009 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
......@@ -32,14 +32,38 @@ from zLOG import LOG, PROBLEM, INFO
class DivergenceMessage(ObjectMessage):
"""
Divergence Message is used for notifications to user about divergences.
Properties are:
* divergence_scope
Scope of divergence as defined in collect_order_group category
* object_relative_url
Relative url of delivery line with divergence
* simulation_movement
Simulation Movement object
* decision_value
Value of decision (reality)
* prevision_value
Value of prevision (simulation)
* tested_property
Id of diverged property
* message
User understandable message about divergence
"""
def getMovementGroup(self):
"""Returns movement group of a builder which was responsible for generating tested_property"""
divergence_scope = getattr(self, 'divergence_scope', None)
if divergence_scope is None:
return []
tested_property = getattr(self, 'tested_property', None)
movement_group_list = []
delivery = self.simulation_movement.getDeliveryValue().getParentValue()
# XXX: assumes one builder used in delivery, will use BPM in future
for builder in delivery.getBuilderList():
for movement_group in builder.getMovementGroupList():
if movement_group.getDivergenceScope() == divergence_scope:
......@@ -48,6 +72,7 @@ class DivergenceMessage(ObjectMessage):
return movement_group
def getCollectOrderGroup(self):
"""Wraps and canonises result of Movement Groups' getCollectOrderGroup getter"""
movement_group = self.getMovementGroup()
if movement_group is not None:
return movement_group.getCollectOrderGroup()
......
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