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 @@ ...@@ -66,13 +66,26 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># This script returns the gap id for this account according to the current gap\n <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 \n
current_gap = context.getPortalObject().portal_preferences.getPreferredAccountingTransactionGap()\n preference_tool = context.getPortalObject().portal_preferences\n
\n \n
for gap in context.getGapValueList() : \n number_method = preference_tool.getPreferredAccountNumberMethod()\n
if current_gap in gap.getPath() : \n \n
return gap.getId()\n if number_method == \'account_reference\':\n
return \'\'\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> </string> </value>
</item> </item>
<item> <item>
...@@ -87,6 +100,12 @@ return \'\'\n ...@@ -87,6 +100,12 @@ return \'\'\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -117,6 +136,8 @@ return \'\'\n ...@@ -117,6 +136,8 @@ return \'\'\n
<tuple> <tuple>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>preference_tool</string>
<string>number_method</string>
<string>current_gap</string> <string>current_gap</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>gap</string> <string>gap</string>
......
...@@ -42,6 +42,12 @@ ...@@ -42,6 +42,12 @@
<tuple/> <tuple/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <string>Base_edit</string> </value> <value> <string>Base_edit</string> </value>
...@@ -106,6 +112,7 @@ ...@@ -106,6 +112,7 @@
<list> <list>
<string>my_preferred_accounting_transaction_simulation_state_list</string> <string>my_preferred_accounting_transaction_simulation_state_list</string>
<string>my_preferred_accounting_transaction_gap</string> <string>my_preferred_accounting_transaction_gap</string>
<string>my_preferred_account_number_method</string>
</list> </list>
</value> </value>
</item> </item>
......
723 724
\ No newline at end of file \ 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