Commit cc140105 authored by Jérome Perrin's avatar Jérome Perrin

accounting: rename ERP5Accounting_getParams to ERP5Site_getAccountingSelectionParameterDict

This was a violation to our naming conventions
parent e5c4ad3f
# precision for editable fields # precision for editable fields
params = context.ERP5Accounting_getParams(selection_name) params = context.ERP5Site_getAccountingSelectionParameterDict(selection_name)
if params.get('precision', None) is not None: if params.get('precision', None) is not None:
context.REQUEST.set('precision', params['precision']) context.REQUEST.set('precision', params['precision'])
......
kwd = context.ERP5Accounting_getParams(selection_name) kwd = context.ERP5Site_getAccountingSelectionParameterDict(selection_name)
# cleanup unsupported catalog parameters # cleanup unsupported catalog parameters
kwd.pop('period_start_date', None) kwd.pop('period_start_date', None)
kwd.pop('detailed_from_date_summary', None) kwd.pop('detailed_from_date_summary', None)
......
portal = context.getPortalObject() 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_increase'] = omit_asset_increase
params['omit_asset_decrease'] = omit_asset_decrease params['omit_asset_decrease'] = omit_asset_decrease
# For now, we omit simulation to be compatible with other reports. # For now, we omit simulation to be compatible with other reports.
params['omit_simulation'] = True 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("period_start_date", None)
params.pop("detailed_from_date_summary", None) params.pop("detailed_from_date_summary", None)
......
portal = context.getPortalObject() 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_increase'] = omit_asset_increase
params['omit_asset_decrease'] = omit_asset_decrease params['omit_asset_decrease'] = omit_asset_decrease
...@@ -24,7 +24,7 @@ else: ...@@ -24,7 +24,7 @@ else:
params['node_uid'] = [x.uid for x in params['node_uid'] = [x.uid for x in
portal.portal_catalog(**selection_params)] 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("period_start_date", None)
params.pop("detailed_from_date_summary", None) params.pop("detailed_from_date_summary", None)
......
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from Products.PythonScripts.standard import Object from Products.PythonScripts.standard import Object
portal = context.getPortalObject() portal = context.getPortalObject()
params = portal.ERP5Accounting_getParams(selection_name) params = portal.ERP5Site_getAccountingSelectionParameterDict(selection_name)
# this also prevents to be called directly # this also prevents to be called directly
assert 'node_uid' in kw assert 'node_uid' in kw
......
...@@ -12,7 +12,7 @@ caveats: ...@@ -12,7 +12,7 @@ caveats:
# do we have a cache already? # do we have a cache already?
if not ignore_cache: if not ignore_cache:
params_cache = context.REQUEST.other.get( params_cache = context.REQUEST.other.get(
'ERP5Accounting_getParams', None) 'ERP5Site_getAccountingSelectionParameterDict', None)
if params_cache is not None: if params_cache is not None:
# return a copy # return a copy
return dict(params_cache) return dict(params_cache)
...@@ -113,5 +113,5 @@ else: ...@@ -113,5 +113,5 @@ else:
params['parent_portal_type'] = parent_portal_type params['parent_portal_type'] = parent_portal_type
if not ignore_cache: if not ignore_cache:
context.REQUEST.other['ERP5Accounting_getParams'] = params context.REQUEST.other['ERP5Site_getAccountingSelectionParameterDict'] = params
return dict(params) return dict(params)
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ERP5Accounting_getParams</string> </value> <value> <string>ERP5Site_getAccountingSelectionParameterDict</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -4,7 +4,7 @@ from Products.ERP5Type.Message import translateString ...@@ -4,7 +4,7 @@ from Products.ERP5Type.Message import translateString
from Products.ERP5Type.Log import log from Products.ERP5Type.Log import log
portal = context.getPortalObject() portal = context.getPortalObject()
request = portal.REQUEST 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: if params.get('precision', None) is not None:
# listbox editable float fields uses request/precision to format the value. # listbox editable float fields uses request/precision to format the value.
......
from Products.ZSQLCatalog.SQLCatalog import Query, SimpleQuery, ComplexQuery from Products.ZSQLCatalog.SQLCatalog import Query, SimpleQuery, ComplexQuery
portal = context.getPortalObject() portal = context.getPortalObject()
params = portal.ERP5Accounting_getParams(selection_name=selection_name) params = portal.ERP5Site_getAccountingSelectionParameterDict(selection_name=selection_name)
getSelectionDomainDictFor = context.portal_selections.getSelectionDomainDictFor getSelectionDomainDictFor = context.portal_selections.getSelectionDomainDictFor
if asset_price: if asset_price:
......
...@@ -3620,7 +3620,7 @@ class TestImmobilisation(TestImmobilisationMixin): ...@@ -3620,7 +3620,7 @@ class TestImmobilisation(TestImmobilisationMixin):
self.assertEqual('group/group B', self.assertEqual('group/group B',
preference_tool.getPreferredAccountingTransactionSectionCategory()) preference_tool.getPreferredAccountingTransactionSectionCategory())
# Make sure to not use the cache # 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(5000.0,account.AccountModule_getTotalSourceDebit(brain=account))
self.assertEqual(0.0,account.AccountModule_getTotalSourceCredit(brain=account)) self.assertEqual(0.0,account.AccountModule_getTotalSourceCredit(brain=account))
......
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