From cc1401055ef1ffa922bab6a100012b8dda0ba472 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 29 Jun 2017 06:43:32 +0000
Subject: [PATCH] accounting: rename ERP5Accounting_getParams to
 ERP5Site_getAccountingSelectionParameterDict

This was a violation to our naming conventions
---
 .../erp5_accounting/AccountModule_getAccountList.py           | 2 +-
 .../AccountModule_getAccountingTransactionCount.py            | 2 +-
 .../portal_skins/erp5_accounting/AccountModule_getBalance.py  | 4 ++--
 .../portal_skins/erp5_accounting/AccountModule_statBalance.py | 4 ++--
 .../Account_getNotGroupedAccountingTransactionList.py         | 2 +-
 ...ams.py => ERP5Site_getAccountingSelectionParameterDict.py} | 4 ++--
 ...s.xml => ERP5Site_getAccountingSelectionParameterDict.xml} | 2 +-
 .../erp5_accounting/Node_getAccountingTransactionList.py      | 2 +-
 .../erp5_accounting/Node_statAccountingBalance.py             | 2 +-
 product/ERP5/tests/testImmobilisation.py                      | 2 +-
 10 files changed, 13 insertions(+), 13 deletions(-)
 rename bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/{ERP5Accounting_getParams.py => ERP5Site_getAccountingSelectionParameterDict.py} (97%)
 rename bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/{ERP5Accounting_getParams.xml => ERP5Site_getAccountingSelectionParameterDict.xml} (96%)

diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountList.py b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountList.py
index 10f9465835..aa9566df6c 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountList.py
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountList.py
@@ -1,5 +1,5 @@
 # precision for editable fields
-params = context.ERP5Accounting_getParams(selection_name)
+params = context.ERP5Site_getAccountingSelectionParameterDict(selection_name)
 if params.get('precision', None) is not None:
   context.REQUEST.set('precision', params['precision'])
 
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountingTransactionCount.py b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountingTransactionCount.py
index 4f92c115bc..c542ac9c52 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountingTransactionCount.py
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountingTransactionCount.py
@@ -1,4 +1,4 @@
-kwd = context.ERP5Accounting_getParams(selection_name)
+kwd = context.ERP5Site_getAccountingSelectionParameterDict(selection_name)
 # cleanup unsupported catalog parameters
 kwd.pop('period_start_date', None)
 kwd.pop('detailed_from_date_summary', None)
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getBalance.py b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getBalance.py
index 2bfc78eb37..0de3b6d558 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getBalance.py
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getBalance.py
@@ -1,11 +1,11 @@
 portal = context.getPortalObject()
-params = portal.ERP5Accounting_getParams(selection_name)
+params = portal.ERP5Site_getAccountingSelectionParameterDict(selection_name)
 params['omit_asset_increase'] = omit_asset_increase
 params['omit_asset_decrease'] = omit_asset_decrease
 # For now, we omit simulation to be compatible with other reports.
 params['omit_simulation'] = True
 
-# Remove params used internally by ERP5Accounting_getParams before passing to inventory API
+# Remove params used internally by ERP5Site_getAccountingSelectionParameterDict before passing to inventory API
 params.pop("period_start_date", None)
 params.pop("detailed_from_date_summary", None)
 
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_statBalance.py b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_statBalance.py
index 02a30db4b7..6f32520ad0 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_statBalance.py
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_statBalance.py
@@ -1,5 +1,5 @@
 portal = context.getPortalObject()
-params = portal.ERP5Accounting_getParams(selection_name)
+params = portal.ERP5Site_getAccountingSelectionParameterDict(selection_name)
 
 params['omit_asset_increase'] = omit_asset_increase
 params['omit_asset_decrease'] = omit_asset_decrease
@@ -24,7 +24,7 @@ else:
   params['node_uid'] = [x.uid for x in
                         portal.portal_catalog(**selection_params)]
 
-# Remove params used internally by ERP5Accounting_getParams before passing to inventory API
+# Remove params used internally by ERP5Site_getAccountingSelectionParameterDict before passing to inventory API
 params.pop("period_start_date", None)
 params.pop("detailed_from_date_summary", None)
 
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getNotGroupedAccountingTransactionList.py b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getNotGroupedAccountingTransactionList.py
index 07a9e7cbd5..ddf2d2cfab 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getNotGroupedAccountingTransactionList.py
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getNotGroupedAccountingTransactionList.py
@@ -1,7 +1,7 @@
 from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
 from Products.PythonScripts.standard import Object
 portal = context.getPortalObject()
-params = portal.ERP5Accounting_getParams(selection_name)
+params = portal.ERP5Site_getAccountingSelectionParameterDict(selection_name)
 
 # this also prevents to be called directly
 assert 'node_uid' in kw
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Accounting_getParams.py b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Site_getAccountingSelectionParameterDict.py
similarity index 97%
rename from bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Accounting_getParams.py
rename to bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Site_getAccountingSelectionParameterDict.py
index f066c9631a..6f002f8868 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Accounting_getParams.py
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Site_getAccountingSelectionParameterDict.py
@@ -12,7 +12,7 @@ caveats:
 # do we have a cache already?
 if not ignore_cache:
   params_cache = context.REQUEST.other.get(
-          'ERP5Accounting_getParams', None)
+          'ERP5Site_getAccountingSelectionParameterDict', None)
   if params_cache is not None:
     # return a copy
     return dict(params_cache)
@@ -113,5 +113,5 @@ else:
     params['parent_portal_type'] = parent_portal_type
 
 if not ignore_cache:
-  context.REQUEST.other['ERP5Accounting_getParams'] = params
+  context.REQUEST.other['ERP5Site_getAccountingSelectionParameterDict'] = params
 return dict(params)
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Accounting_getParams.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Site_getAccountingSelectionParameterDict.xml
similarity index 96%
rename from bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Accounting_getParams.xml
rename to bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Site_getAccountingSelectionParameterDict.xml
index 0f5bf715df..28cd58e890 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Accounting_getParams.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/ERP5Site_getAccountingSelectionParameterDict.xml
@@ -54,7 +54,7 @@
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>ERP5Accounting_getParams</string> </value>
+            <value> <string>ERP5Site_getAccountingSelectionParameterDict</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_getAccountingTransactionList.py b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_getAccountingTransactionList.py
index 418dd9a94d..03284bad6a 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_getAccountingTransactionList.py
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_getAccountingTransactionList.py
@@ -4,7 +4,7 @@ from Products.ERP5Type.Message import translateString
 from Products.ERP5Type.Log import log
 portal = context.getPortalObject()
 request = portal.REQUEST
-params = portal.ERP5Accounting_getParams(selection_name=selection_name)
+params = portal.ERP5Site_getAccountingSelectionParameterDict(selection_name=selection_name)
 
 if params.get('precision', None) is not None:
   # listbox editable float fields uses request/precision to format the value.
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_statAccountingBalance.py b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_statAccountingBalance.py
index 1260406344..abf4b4a861 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_statAccountingBalance.py
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Node_statAccountingBalance.py
@@ -1,7 +1,7 @@
 from Products.ZSQLCatalog.SQLCatalog import Query, SimpleQuery, ComplexQuery
 portal = context.getPortalObject()
 
-params = portal.ERP5Accounting_getParams(selection_name=selection_name)
+params = portal.ERP5Site_getAccountingSelectionParameterDict(selection_name=selection_name)
 getSelectionDomainDictFor = context.portal_selections.getSelectionDomainDictFor
 
 if asset_price:
diff --git a/product/ERP5/tests/testImmobilisation.py b/product/ERP5/tests/testImmobilisation.py
index 7fc85d6723..93fedfcafa 100644
--- a/product/ERP5/tests/testImmobilisation.py
+++ b/product/ERP5/tests/testImmobilisation.py
@@ -3620,7 +3620,7 @@ class TestImmobilisation(TestImmobilisationMixin):
     self.assertEqual('group/group B',
         preference_tool.getPreferredAccountingTransactionSectionCategory())
     # Make sure to not use the cache
-    self.portal.REQUEST['ERP5Accounting_getParams'] = None
+    self.portal.REQUEST['ERP5Site_getAccountingSelectionParameterDict'] = None
     self.assertEqual(5000.0,account.AccountModule_getTotalSourceDebit(brain=account))
     self.assertEqual(0.0,account.AccountModule_getTotalSourceCredit(brain=account))
 
-- 
2.30.9