Commit ca65ee1a authored by Łukasz Nowak's avatar Łukasz Nowak

- rename class DivergenceDecision to DivergenceSolutionDecision as previous...

 - rename class DivergenceDecision to DivergenceSolutionDecision as previous name was not describing properly its usage


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28766 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ac62d8f3
......@@ -32,7 +32,7 @@ from Products.PythonScripts.Utility import allow_class
from AccessControl import ClassSecurityInfo
from Persistence import Persistent
class DivergenceDecision(Persistent):
class DivergenceSolutionDecision(Persistent):
"""Decision class
Represent decision took during solving divergence between reality and
......@@ -75,7 +75,7 @@ class DivergenceDecision(Persistent):
split_kw
Dictionary passed to TargetSolver in case of splitting.
"""
meta_type = "DivergenceDecision"
meta_type = "DivergenceSolutionDecision"
security = ClassSecurityInfo()
security.declareObjectPublic() # FIXME need to be decided
......@@ -102,5 +102,5 @@ class DivergenceDecision(Persistent):
raise ValueError(
'Decision %s is not supported' % self.decision)
InitializeClass(DivergenceDecision)
allow_class(DivergenceDecision)
InitializeClass(DivergenceSolutionDecision)
allow_class(DivergenceSolutionDecision)
......@@ -508,12 +508,12 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated,
"""How to play
delivery_line = context
from DateTime import DateTime
from Products.ERP5.DivergenceDecision import DivergenceDecision
from Products.ERP5.DivergenceSolutionDecision import DivergenceSolutionDecision
decision_list = []
# adopt
for d in context.getDivergenceList():
decision = DivergenceDecision(d, 'adopt', None, None)
decision = DivergenceSolutionDecision(d, 'adopt', None, None)
decision_list.append(decision)
delivery_line.solve(decision_list)
......@@ -525,7 +525,7 @@ for d in delivery_line.getDivergenceList():
split_kw = {}
split_kw.update(start_date = DateTime('2009/01/01'),
stop_date = DateTime('2009/01/10'))
decision = DivergenceDecision(d, 'split', None, 'SplitAndDefer',
decision = DivergenceSolutionDecision(d, 'split', None, 'SplitAndDefer',
split_kw = split_kw)
decision_list.append(decision)
......@@ -535,7 +535,7 @@ return 'ok'
# adopt
for d in delivery_line.getDivergenceList():
if d.tested_property == 'quantity':
decision = DivergenceDecision(d, 'adopt', None, None)
decision = DivergenceSolutionDecision(d, 'adopt', None, None)
decision_list.append(decision)
delivery_line.solve(decision_list)
......
......@@ -375,7 +375,7 @@ class Rule(Predicate, XMLObject):
# TODO: support compensation if not prevent_compensation
LOG('%s:%s' % (self.getRelativeUrl(), movement.getRelativeUrl()), WARNING,
'Quantity forced to stay as %s, even if wanted %s' % (m_quantity, prevision.get('quantity')))
# DivergenceDecision mangle
# DivergenceSolutionDecision mangle
pass
else:
q_diff = prevision.get('quantity') - m_quantity
......@@ -402,7 +402,7 @@ class Rule(Predicate, XMLObject):
# support compensation if not prevent_compensation
LOG('%s:%s' % (self.getRelativeUrl(), movement.getRelativeUrl()), WARNING,
'Property %s forced to stay as %r, even if wanted %r' % (k, movement.getProperty(k), v))
# DivergenceDecision mangle
# DivergenceSolutionDecision mangle
continue
prop_dict.setdefault(k, v)
......
......@@ -99,8 +99,8 @@ def initialize( context ):
'WorkflowException')
ModuleSecurityInfo('Products.ERP5.Document.Image').declarePublic(
'getSizeFromImageDisplay')
ModuleSecurityInfo('Products.ERP5.DivergenceDecision').declarePublic(
'DivergenceDecision')
ModuleSecurityInfo('Products.ERP5.DivergenceSolutionDecision') \
.declarePublic('DivergenceSolutionDecision')
# backward compatibility names
XML = None
......
......@@ -35,7 +35,7 @@ class IDivergenceSolver(Interface):
def solve(decision_list):
"""Solves divergences on self according to decision_list
decision_list is list of instances of DivergenceDecision class
decision_list is list of instances of DivergenceSolutionDecision class
"""
class IDeliverySolver(Interface):
......
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