Commit 69733f8d authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* calculate the value only once.

* some cosmetic changes.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25301 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 07496753
...@@ -76,22 +76,21 @@ def sort_by_date(a, b):\n ...@@ -76,22 +76,21 @@ def sort_by_date(a, b):\n
if movement is None:\n if movement is None:\n
return context.Resource_getPriceCalculationOperandDict(**kw)\n return context.Resource_getPriceCalculationOperandDict(**kw)\n
else:\n else:\n
# sort_method can already exist in kw. # sort_method can already exist in kw.\n
kw[\'sort_method\'] = sort_by_date\n kw[\'sort_method\'] = sort_by_date\n
predicate_list = context.portal_domains.searchPredicateList(\n predicate_list = context.portal_domains.searchPredicateList(\n
context=movement,\n context=movement,\n
portal_type=\'Currency Exchange Line\',\n portal_type=\'Currency Exchange Line\',\n
validation_state=\'validated\',\n validation_state=\'validated\',\n
test =1,\n test=1,\n
**kw )\n **kw)\n
\n
\n
\n \n
# For each predicate(i.e: Currency Exchange Line) found, get the exchange rate\n # For each predicate(i.e: Currency Exchange Line) found, get the exchange rate\n
# with the reference currency\n # with the reference currency\n
for predicate in predicate_list:\n for predicate in predicate_list:\n
if predicate.Resource_getPriceCalculationOperandDict(movement=predicate,**kw) is not None:\n operand_dict = predicate.Resource_getPriceCalculationOperandDict(movement=predicate, **kw)\n
return predicate.Resource_getPriceCalculationOperandDict(movement=predicate,**kw)\n if operand_dict is not None:\n
return operand_dict\n
]]></string> </value> ]]></string> </value>
...@@ -104,7 +103,7 @@ else:\n ...@@ -104,7 +103,7 @@ else:\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>default=None,movement=None, REQUEST=None, **kw</string> </value> <value> <string>default=None, movement=None, REQUEST=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -139,9 +138,11 @@ else:\n ...@@ -139,9 +138,11 @@ else:\n
<string>_apply_</string> <string>_apply_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>_write_</string>
<string>predicate_list</string> <string>predicate_list</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>predicate</string> <string>predicate</string>
<string>operand_dict</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
512 513
\ No newline at end of file \ No newline at end of file
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