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

accounting: remove unused Account_getDestinationSectionItemList

parent 309579c4
node_uid=None
if not account:
if (hasattr(context, 'getPortalType') and context.getPortalType() == 'Account') :
node_uid = context.getUid()
elif same_type(account, '') :
account = context.getPortalObject().restrictedTraverse(account)
node_uid = account.getUid()
ptype_translated_dict = {}
def translatePortalType(ptype) :
"""Translate portal_type without retrieving the object from ZODB."""
if not ptype_translated_dict.has_key(ptype) :
ptype_translated_dict[ptype] = context.Base_translateString(ptype)
return ptype_translated_dict[ptype]
section_uid = []
if section_category:
section_uid = context.Base_getSectionUidListForSectionCategory(
section_category, strict_membership=section_category_strict_membership)
item_list = [("", "")]
for entity in context.Account_zDistinctSectionList(node_uid=node_uid,
section_uid=section_uid):
item_list.append(("%s (%s)" % ( entity['title'],
translatePortalType(entity['portal_type'])),
entity['relative_url']))
return item_list
<?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>_params</string> </key>
<value> <string>account=\'\', section_category=\'\', section_category_strict_membership=True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Account_getDestinationSectionItemList</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>TODO: rename into AccountModule_getMirrorSectionItemList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -4160,27 +4160,6 @@ class TestTransactions(AccountingTestCase):
self.assertEqual(500, accounting_transaction.AccountingTransaction_getTotalDebit())
self.assertEqual(400, accounting_transaction.AccountingTransaction_getTotalCredit())
def test_Account_getDestinationSectionItemList(self):
organisation1 = self.portal.organisation_module.newContent(
portal_type='Organisation',
title='Organisation 1')
organisation2 = self.portal.organisation_module.newContent(
portal_type='Organisation',
title='Organisation 2')
self._makeOne(
portal_type='Sale Invoice Transaction',
simulation_state='delivered',
destination_section_value=organisation1,
start_date=DateTime(2006, 2, 2),
lines=(dict(source_value=self.portal.account_module.receivable,
source_debit=100),
dict(source_value=self.portal.account_module.goods_sales,
source_credit=100.00)))
self.assertEqual([('', ''),
('Organisation 1 (Organisation)',
organisation1.getRelativeUrl())],
self.portal.Account_getDestinationSectionItemList())
def test_AccountingTransaction_getListBoxColumnList_does_not_enable_section_column_when_only_two_sections(self):
# AccountingTransaction_getListBoxColumnList is the script returning the
# columns to display in AccountingTransaction_view.
......
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