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

in dialogs, display all validated accounts and accounts that have been used in movements

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41545 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4604482d
......@@ -265,13 +265,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
......@@ -284,19 +278,13 @@
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.AccountingTransactionLine_getNodeItemList()</string> </value>
<value> <string>python: context.ERP5Site_getAccountItemList(section_category=request.get(\'your_section_category\', preferences.getPreferredAccountingTransactionSectionCategory()), section_category_strict=request.get(\'your_section_category_strict\', preferences.getPreferredAccountingSectionCategoryStrict()), from_date=request.get(\'your_from_date\', preferences.getPreferredAccountingTransactionFromDate()))</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -259,13 +259,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
......@@ -278,19 +272,13 @@
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/AccountingTransactionLine_getNodeItemList</string> </value>
<value> <string>python: context.ERP5Site_getAccountItemList(section_category=request.get(\'your_section_category\', preferences.getPreferredAccountingTransactionSectionCategory()), section_category_strict=request.get(\'your_section_category_strict\', preferences.getPreferredAccountingSectionCategoryStrict()), from_date=request.get(\'your_from_date\', preferences.getPreferredAccountingTransactionFromDate()))</string> </value>
</item>
</dictionary>
</pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>\'\'\'Returns all validated accounts + all accounts used by this group on existing\n
movements.\n
\n
\'\'\'\n
from Products.ERP5Type.Cache import CachingMethod\n
\n
portal = context.getPortalObject()\n
\n
def getAccountItemList(section_category,\n
section_category_strict,\n
from_date,\n
lang):\n
\n
def sorted(seq, key):\n
seq = seq[::]\n
seq.sort(key=key)\n
return seq\n
\n
account_dict = dict()\n
for account in portal.account_module.searchFolder(\n
portal_type=\'Account\',\n
validation_state=(\'validated\',), ):\n
account = account.getObject()\n
\n
account_dict[account.getUid()] = [\n
account.Account_getFormattedTitle(),\n
account.getRelativeUrl(), ]\n
\n
search_kw = dict(\n
portal_type=portal.getPortalAccountingMovementTypeList(),\n
ignore_group_by=True,\n
group_by_node=True,)\n
if from_date:\n
search_kw[\'from_date\'] = from_date\n
if section_category_strict:\n
search_kw[\'section_category_strict_membership\'] = section_category\n
else:\n
search_kw[\'section_category\'] = section_category\n
\n
# add to this the accounts that have been used in accounting transactions.\n
for brain in portal.portal_simulation.getCurrentInventoryList( **search_kw ):\n
if brain.node_uid and brain.node_uid not in account_dict:\n
account = portal.portal_catalog.getObject(brain.node_uid)\n
account_dict[brain.node_uid] = [\n
account.Account_getFormattedTitle(),\n
account.getRelativeUrl(), ]\n
\n
return [(\'\', \'\')] + sorted(account_dict.values(),\n
key=lambda item: item[1])\n
\n
getAccountItemList = CachingMethod(getAccountItemList,\n
id=script.getId(),\n
cache_factory=\'erp5_content_long\')\n
\n
return getAccountItemList(section_category,\n
section_category_strict,\n
lang=portal.Localizer.get_selected_language(),\n
from_date=from_date)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>section_category, section_category_strict, from_date</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>section_category</string>
<string>section_category_strict</string>
<string>from_date</string>
<string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>getAccountItemList</string>
<string>script</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_getAccountItemList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
1412
\ No newline at end of file
1413
\ 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