Commit b3d599ca authored by Romain Courteaud's avatar Romain Courteaud

Modify Account_getGapId, in order to handle the 'preferred_account_number_method'

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22435 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 635fafea
......@@ -66,13 +66,26 @@
<item>
<key> <string>_body</string> </key>
<value> <string># This script returns the gap id for this account according to the current gap\n
# XXX This script is badly name, as it does not truly return a category ID.\n
# XXX Instead, the purpose of this script is more to return an account number to display\n
\n
current_gap = context.getPortalObject().portal_preferences.getPreferredAccountingTransactionGap()\n
preference_tool = context.getPortalObject().portal_preferences\n
\n
for gap in context.getGapValueList() : \n
if current_gap in gap.getPath() : \n
return gap.getId()\n
return \'\'\n
number_method = preference_tool.getPreferredAccountNumberMethod()\n
\n
if number_method == \'account_reference\':\n
return context.getReference(\'\')\n
\n
# elif number_method == \'gap_id\':\n
else:\n
# GAP id is the default rendering\n
\n
current_gap = preference_tool.getPreferredAccountingTransactionGap()\n
\n
for gap in context.getGapValueList() : \n
if current_gap in gap.getPath() : \n
return gap.getId()\n
return \'\'\n
</string> </value>
</item>
<item>
......@@ -87,6 +100,12 @@ return \'\'\n
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
......@@ -117,6 +136,8 @@ return \'\'\n
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>preference_tool</string>
<string>number_method</string>
<string>current_gap</string>
<string>_getiter_</string>
<string>gap</string>
......
......@@ -42,6 +42,12 @@
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
......@@ -106,6 +112,7 @@
<list>
<string>my_preferred_accounting_transaction_simulation_state_list</string>
<string>my_preferred_accounting_transaction_gap</string>
<string>my_preferred_account_number_method</string>
</list>
</value>
</item>
......
723
\ No newline at end of file
724
\ 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