From 7da5bb8f94d4b519c2e5b747faaad1287fdb0bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Fri, 9 Mar 2007 17:10:56 +0000 Subject: [PATCH] Also get and cache the following parameters for ERP5Accounting_getParams: section_uid (have priority over any section_category) precision (have priority over the one calculated from section category) mirror_section_uid payment_uid parent_portal_type git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13313 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../ERP5Accounting_getParams.xml | 26 +++++++++++++++++++ bt5/erp5_accounting/bt/revision | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Accounting_getParams.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Accounting_getParams.xml index 8d427b6133..80e92dd5a1 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Accounting_getParams.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Accounting_getParams.xml @@ -114,12 +114,33 @@ if section_category:\n params[\'precision\'] = context.account_module\\\n .getQuantityPrecisionFromResource(currency)\n \n +# if we have a section uid, it haves priority\n +section_uid = selection_params.get(\'section_uid\', None)\n +if section_uid:\n + params.pop(\'section_category\', None)\n + params[\'section_uid\'] = section_uid\n +\n +# also if we have an explicit precision key, it has priority\n +precision = selection_params.get(\'precision\', None)\n +if precision is not None:\n + params[\'precision\'] = precision\n +\n +mirror_section_uid = selection_params.get(\'mirror_section_uid\', None)\n +if mirror_section_uid:\n + params[\'mirror_section_uid\'] = mirror_section_uid\n +\n +payment_uid = selection_params.get(\'payment_uid\', None)\n +if payment_uid:\n + params[\'payment_uid\'] = payment_uid\n \n simulation_state = selection_params.get(\'simulation_state\',\n preference.getPreferredAccountingTransactionSimulationStateList())\n if simulation_state:\n params[\'simulation_state\'] = simulation_state\n \n +parent_portal_type = selection_params.get(\'parent_portal_type\', None)\n +if parent_portal_type:\n + params[\'parent_portal_type\'] = parent_portal_type\n \n if not ignore_cache:\n context.REQUEST.other[\'ERP5Accounting_getParams\'] = params\n @@ -182,7 +203,12 @@ return dict(params)\n <string>at_date</string> <string>section_category</string> <string>currency</string> + <string>section_uid</string> + <string>precision</string> + <string>mirror_section_uid</string> + <string>payment_uid</string> <string>simulation_state</string> + <string>parent_portal_type</string> </tuple> </value> </item> diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision index 4c009fb2fb..bea0d09c49 100644 --- a/bt5/erp5_accounting/bt/revision +++ b/bt5/erp5_accounting/bt/revision @@ -1 +1 @@ -206 \ No newline at end of file +207 \ No newline at end of file -- 2.30.9