Commit 2837b034 authored by Łukasz Nowak's avatar Łukasz Nowak

- move setting static property dict to method, easier to class method for re usability


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26882 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 95855582
......@@ -106,6 +106,12 @@ class TradeModelRule(TransformationRule):
return movement_dict
def _getStaticPropertyDict(self, context_movement):
movement_kw = {}
for prop in self.getExpandablePropertyList():
movement_kw[prop] = context_movement.getProperty(prop)
return movement_kw
def _generatePrevisionList(self, applied_rule, **kw):
"""Generates list of movements (as dicts), and let parent class to decide
which is to add, modify or delete"""
......@@ -118,10 +124,8 @@ class TradeModelRule(TransformationRule):
for amount in trade_condition.getAggregatedAmountList(applied_rule):
context_movement = applied_rule.getParentValue()
movement_kw = {}
# everything static
for prop in self.getExpandablePropertyList():
movement_kw[prop] = context_movement.getProperty(prop)
movement_kw = self._getStaticPropertyDict(context_movement)
# business path specific
business_path_list = business_process.getPathValueList(
......
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