[Erp5-report] r15274 - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal_skins/er...
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Jul 23 11:34:09 CEST 2007
Author: jerome
Date: Mon Jul 23 11:34:08 2007
New Revision: 15274
URL: http://svn.erp5.org?rev=15274&view=rev
Log:
Improve AccountModule_getBankAccountItemList to prevent displaying deleted bank accounts.
Update AccountingTransaction_getSourcePaymentItemList and AccountingTransaction_getDestinationPaymentItemList to use it.
Modified:
erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getBankAccountItemList.xml
erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getDestinationPaymentItemList.xml
erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getSourcePaymentItemList.xml
erp5/trunk/bt5/erp5_accounting/bt/revision
Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getBankAccountItemList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getBankAccountItemList.xml?rev=15274&r1=15273&r2=15274&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getBankAccountItemList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getBankAccountItemList.xml Mon Jul 23 11:34:08 2007
@@ -68,25 +68,35 @@
</item>
<item>
<key> <string>_body</string> </key>
- <value> <string>portal = context.getPortalObject()\n
-if organisation == \'\' :\n
- organisation = context.REQUEST.get(\'organisation\', None)\n
-if organisation is None : \n
+ <value> <string>from ZTUtils import LazyFilter\n
+portal = context.getPortalObject()\n
+\n
+if not organisation:\n
organisation = portal.portal_preferences\\\n
.getPreferredAccountingTransactionSourceSection()\n
\n
-organisation = portal.restrictedTraverse(organisation)\n
+if not organisation:\n
+ return [(\'\', \'\')]\n
+\n
+\n
+organisation_value = portal.restrictedTraverse(organisation)\n
item_list = [(\'\', \'\')]\n
-for bank in organisation.contentValues(\n
- portal_type=portal.getPortalPaymentNodeTypeList()):\n
- if bank.getReference() and bank.getReference() != bank.getTitle():\n
- item_list.append((\'%s - %s\' % (bank.getReference(),\n
- bank.getTitle() or \n
- bank.getSourceFreeText() or\n
- bank.getSourceTitle()),\n
- bank.getRelativeUrl()))\n
+for bank in LazyFilter(organisation_value.contentValues(\n
+ portal_type=portal.getPortalPaymentNodeTypeList()), skip=\'View\'):\n
+\n
+ if skip_invalidated_bank_accounts and bank.getValidationState() == \'invalidated\':\n
+ continue\n
+ \n
+ if bank.getReference() and bank.getTitle() \\\n
+ and bank.getReference() != bank.getTitle():\n
+ item_list.append((\'%s - %s\' % ( bank.getReference(),\n
+ bank.getTitle() or \n
+ bank.getSourceFreeText() or\n
+ bank.getSourceTitle()),\n
+ bank.getRelativeUrl()))\n
else:\n
- item_list.append(( bank.getTitle() or \n
+ item_list.append(( bank.getReference() or\n
+ bank.getTitle() or \n
bank.getSourceFreeText() or\n
bank.getSourceTitle(),\n
bank.getRelativeUrl() ))\n
@@ -107,8 +117,14 @@
</value>
</item>
<item>
+ <key> <string>_owner</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
<key> <string>_params</string> </key>
- <value> <string>organisation = \'\'</string> </value>
+ <value> <string>organisation=None, skip_invalidated_bank_accounts=1</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
@@ -128,17 +144,20 @@
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
- <value> <int>1</int> </value>
+ <value> <int>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>organisation</string>
+ <string>skip_invalidated_bank_accounts</string>
+ <string>ZTUtils</string>
+ <string>LazyFilter</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
- <string>None</string>
+ <string>organisation_value</string>
<string>item_list</string>
<string>_getiter_</string>
<string>bank</string>
@@ -154,7 +173,8 @@
<key> <string>func_defaults</string> </key>
<value>
<tuple>
- <string></string>
+ <none/>
+ <int>1</int>
</tuple>
</value>
</item>
Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getDestinationPaymentItemList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getDestinationPaymentItemList.xml?rev=15274&r1=15273&r2=15274&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getDestinationPaymentItemList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getDestinationPaymentItemList.xml Mon Jul 23 11:34:08 2007
@@ -68,26 +68,10 @@
</item>
<item>
<key> <string>_body</string> </key>
- <value> <string>def sort(a, b):\n
- return cmp(a[0], b[0])\n
-\n
-item_list = [[\'\', \'\']]\n
-\n
-entity = context.getDestinationSectionValue()\n
-if entity is not None:\n
- bank_account_id_list = entity.contentIds(filter={\'portal_type\':\n
- entity.getPortalPaymentNodeTypeList()})\n
- for bank_account_id in bank_account_id_list:\n
- # skip objects we are not allowed to access\n
- bank_account = entity.restrictedTraverse(bank_account_id, None)\n
- if bank_account is not None and \\\n
- bank_account.getValidationState() != \'invalidated\':\n
- url = bank_account.getRelativeUrl()\n
- label = bank_account.getReference() or bank_account.getTitle()\n
- item_list.append([label, url])\n
-\n
-item_list.sort(sort)\n
-return item_list\n
+ <value> <string>return context.AccountModule_getBankAccountItemList(\n
+ organisation=context.getDestinationSection(),\n
+ skip_invalidated_bank_accounts=\n
+ (context.getSimulationState() != \'delivered\'))\n
</string> </value>
</item>
<item>
@@ -130,18 +114,8 @@
<key> <string>co_varnames</string> </key>
<value>
<tuple>
- <string>sort</string>
- <string>item_list</string>
<string>_getattr_</string>
<string>context</string>
- <string>entity</string>
- <string>None</string>
- <string>bank_account_id_list</string>
- <string>_getiter_</string>
- <string>bank_account_id</string>
- <string>bank_account</string>
- <string>url</string>
- <string>label</string>
</tuple>
</value>
</item>
Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getSourcePaymentItemList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getSourcePaymentItemList.xml?rev=15274&r1=15273&r2=15274&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getSourcePaymentItemList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getSourcePaymentItemList.xml Mon Jul 23 11:34:08 2007
@@ -68,26 +68,10 @@
</item>
<item>
<key> <string>_body</string> </key>
- <value> <string>def sort(a, b):\n
- return cmp(a[0], b[0])\n
-\n
-item_list = [[\'\', \'\']]\n
-\n
-entity = context.getSourceSectionValue()\n
-if entity is not None:\n
- bank_account_id_list = entity.contentIds(filter={\'portal_type\':\n
- entity.getPortalPaymentNodeTypeList()})\n
- for bank_account_id in bank_account_id_list:\n
- # skip objects we are not allowed to access\n
- bank_account = entity.restrictedTraverse(bank_account_id, None)\n
- if bank_account is not None and \\\n
- bank_account.getValidationState() != \'invalidated\':\n
- url = bank_account.getRelativeUrl()\n
- label = bank_account.getReference() or bank_account.getTitle()\n
- item_list.append([label, url])\n
-\n
-item_list.sort(sort)\n
-return item_list\n
+ <value> <string>return context.AccountModule_getBankAccountItemList(\n
+ organisation=context.getSourceSection(),\n
+ skip_invalidated_bank_accounts=\n
+ (context.getSimulationState() != \'delivered\'))\n
</string> </value>
</item>
<item>
@@ -130,18 +114,8 @@
<key> <string>co_varnames</string> </key>
<value>
<tuple>
- <string>sort</string>
- <string>item_list</string>
<string>_getattr_</string>
<string>context</string>
- <string>entity</string>
- <string>None</string>
- <string>bank_account_id_list</string>
- <string>_getiter_</string>
- <string>bank_account_id</string>
- <string>bank_account</string>
- <string>url</string>
- <string>label</string>
</tuple>
</value>
</item>
Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=15274&r1=15273&r2=15274&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision Mon Jul 23 11:34:08 2007
@@ -1,1 +1,1 @@
-365
+368
More information about the Erp5-report
mailing list