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
master 2017_04 2018_10 2018_10_squashed HBTreeFolder2 allow_login_change allow_login_change_wip arnau arnau-kns arnau-kns-without-property-mapping arnau-merge arnau-poc auto_extend_select_list autoflake backup_erp5_workflow bk_erp5ish_actions_tool bk_sqlcatalog boc-interaction-drop bt_owner cache catalog_fulltext catalog_fulltext_old cedric cedriclen cedriclen-eos certificate_authority cherry-pick-116c24a0 cherry-pick-6f9973dd cleanJSByJSLint clean_up_upgrader compact_title_no_reference credential_update_action datetimefield deferred_listbox douglas_forum dream_distributor drop-legacy-simulation eos-dev erp5-component erp5-data-notebook erp5-forum erp5-preference erp5-release erp5-slapos-upgrade erp5-util-testing erp5-vifib erp5-vifib-cleanup erp5_calendar erp5_free_subscription erp5_workflow fix_system_processes_ownership for_testrunner_1 gabriel gabriel-fix-rounding-in-accounting-generation gabriel-fix-rounding-in-accounting-generation2 gadget-json-value http_cache_fix improve_default_caching_policy_manager interaction-drop isDeletable item_tracking_graph_editor ivan jerome-bt-reference-doc jerome-test jerome_composition_archived jerome_events jerome_graph_editor jerome_graph_editor_renderjs jerome_new_style_solve_divergence jerome_promise_in_tests jerome_user_preference_time_zone jio kns lazy_simulation_causality lignan lingnan listbox-generator mame mame-bt5-cleanup mame-erp5_project-cleanup mame-naming-convention mame-naming-convention-list_method mame-test-stock-indexation mame-work mame2 master-erp5-test-result-scalability master-erp5-test-result-scalability-rebase master-test-fix-additionalbt5path master_no_guard_on_workflow_transition merge_xhtml_jquery mmariani-inventory mrp new-render-presentation nexedi-erp5-jp notification_tool_constraint ods_style_sheet_per_report_section_deferred_style officejs pere portal_solver_process_security_configuration presentation rafael rafael-interaction-drop-cleanup rafael-promise rafael-taskdistribution rebased_mrp romain-fulltext scalability-master2 scalability-master2-rebase scalability-rebase shop-box shop-box-rebased simulation sms_activate strict_catalog syncml test_page testnode_software_link timezones tristan tristan-merge tristan-performance ttr ttrm upgradeSite vivekpab_erp5webrenderjs_layoutconfig vivekpab_jabberclient vivekpab_renderjs_interfaces wenjie wenjie_branch xiaowu_newui yryr yryr-components-cp yryr-inventory-cache yryr-test yryr-with-components yusei erp5.util-0.4.44 erp5.util-0.4.43 erp5.util-0.4.41 erp5.util-0.4.40 erp5.util-0.4.37 erp5.util-0.4.1 erp5.util-0.4 erp5.util-0.3 erp5.util-0.2 erp5.util-0.1
No related merge requests found
......@@ -76,22 +76,21 @@ def sort_by_date(a, b):\n
if movement is None:\n
return context.Resource_getPriceCalculationOperandDict(**kw)\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
predicate_list = context.portal_domains.searchPredicateList(\n
context=movement,\n
portal_type=\'Currency Exchange Line\',\n
validation_state=\'validated\',\n
test =1,\n
**kw )\n
\n
\n
context=movement,\n
portal_type=\'Currency Exchange Line\',\n
validation_state=\'validated\',\n
test=1,\n
**kw)\n
\n
# For each predicate(i.e: Currency Exchange Line) found, get the exchange rate\n
# with the reference currency\n
# For each predicate(i.e: Currency Exchange Line) found, get the exchange rate\n
# with the reference currency\n
for predicate in predicate_list:\n
if predicate.Resource_getPriceCalculationOperandDict(movement=predicate,**kw) is not None:\n
return predicate.Resource_getPriceCalculationOperandDict(movement=predicate,**kw)\n
operand_dict = predicate.Resource_getPriceCalculationOperandDict(movement=predicate, **kw)\n
if operand_dict is not None:\n
return operand_dict\n
]]></string> </value>
......@@ -104,7 +103,7 @@ else:\n
</item>
<item>
<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>
<key> <string>errors</string> </key>
......@@ -139,9 +138,11 @@ else:\n
<string>_apply_</string>
<string>_getattr_</string>
<string>context</string>
<string>_write_</string>
<string>predicate_list</string>
<string>_getiter_</string>
<string>predicate</string>
<string>operand_dict</string>
</tuple>
</value>
</item>
......
512
\ No newline at end of file
513
\ 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