Commit 031e8f93 authored by Jérome Perrin's avatar Jérome Perrin

add a "request.other[\'is_accounting_report\'] = True" in all accounting...

add a "request.other[\'is_accounting_report\'] = True" in all accounting reports, so that certain fields can be hidden in reports.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9713 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 229eb26d
...@@ -68,8 +68,7 @@ ...@@ -68,8 +68,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>"""Get the report sections for account statement.\n
Get the report sections for account statement.\n
Account is the combination of :\n Account is the combination of :\n
- node (the Account in account module)\n - node (the Account in account module)\n
- destination_section (the Entity in organisation / person module)\n - destination_section (the Entity in organisation / person module)\n
...@@ -89,6 +88,8 @@ transaction_simulation_state = request[\'transaction_simulation_state\']\n ...@@ -89,6 +88,8 @@ transaction_simulation_state = request[\'transaction_simulation_state\']\n
from_date = request.get(\'from_date\', None)\n from_date = request.get(\'from_date\', None)\n
omit_grouping_reference = request.get(\'omit_grouping_reference\', 0)\n omit_grouping_reference = request.get(\'omit_grouping_reference\', 0)\n
\n \n
request.other[\'is_accounting_report\'] = True\n
\n
params = {\n params = {\n
\'at_date\' : at_date,\n \'at_date\' : at_date,\n
\'section_category\' : transaction_section_category,\n \'section_category\' : transaction_section_category,\n
...@@ -99,16 +100,6 @@ params = {\n ...@@ -99,16 +100,6 @@ params = {\n
\'from_date_summary\' : 1\n \'from_date_summary\' : 1\n
}\n }\n
\n \n
preferences = {\n
\'preferred_accounting_transaction_at_date\' : at_date,\n
\'preferred_accounting_transaction_simulation_state\' :\n
transaction_simulation_state,\n
\'preferred_accounting_transaction_section_category\' :\n
transaction_section_category,\n
# XXX put omit_grouping_reference in preferences ?\n
\'preferred_accounting_omit_grouping_reference\' : omit_grouping_reference,\n
}\n
\n
if from_date:\n if from_date:\n
params[\'from_date\'] = from_date\n params[\'from_date\'] = from_date\n
preferences[\'preferred_accounting_transaction_from_date\'] = from_date\n preferences[\'preferred_accounting_transaction_from_date\'] = from_date\n
...@@ -121,9 +112,6 @@ if destination_section :\n ...@@ -121,9 +112,6 @@ if destination_section :\n
if account:\n if account:\n
params[\'node_uid\'] = context.restrictedTraverse(account).getUid()\n params[\'node_uid\'] = context.restrictedTraverse(account).getUid()\n
\n \n
from Products.ERP5Type.Cache import clearCache\n
clearCache() # for preferences\n
\n
result = []\n result = []\n
portal = context.portal_url.getPortalObject()\n portal = context.portal_url.getPortalObject()\n
\n \n
...@@ -147,8 +135,8 @@ return [ReportSection(\n ...@@ -147,8 +135,8 @@ return [ReportSection(\n
selection_params = params,\n selection_params = params,\n
selection_columns = account_columns,\n selection_columns = account_columns,\n
listbox_display_mode = \'FlatListMode\',\n listbox_display_mode = \'FlatListMode\',\n
selection_sort_order = [(\'delivery.stop_date\', \'ascending\')],\n selection_sort_order = [(\'delivery.stop_date\',\n
preferences = preferences )]\n \'ascending\')],)]\n
# vim: syntax=python\n # vim: syntax=python\n
</string> </value> </string> </value>
</item> </item>
...@@ -213,11 +201,10 @@ return [ReportSection(\n ...@@ -213,11 +201,10 @@ return [ReportSection(\n
<string>transaction_simulation_state</string> <string>transaction_simulation_state</string>
<string>from_date</string> <string>from_date</string>
<string>omit_grouping_reference</string> <string>omit_grouping_reference</string>
<string>True</string>
<string>_write_</string>
<string>params</string> <string>params</string>
<string>preferences</string> <string>preferences</string>
<string>_write_</string>
<string>Products.ERP5Type.Cache</string>
<string>clearCache</string>
<string>result</string> <string>result</string>
<string>portal</string> <string>portal</string>
<string>account_columns</string> <string>account_columns</string>
......
...@@ -134,6 +134,12 @@ return result\n ...@@ -134,6 +134,12 @@ return result\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>_filepath</string> </key> <key> <string>_filepath</string> </key>
<value> <value>
...@@ -216,4 +222,25 @@ return result\n ...@@ -216,4 +222,25 @@ return result\n
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -70,8 +70,7 @@ ...@@ -70,8 +70,7 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
"""\n """Client & vendors accounts.\n
Client & vendors accounts.\n
"""\n """\n
\n \n
from Products.ERP5Form.Report import ReportSection\n from Products.ERP5Form.Report import ReportSection\n
...@@ -84,6 +83,8 @@ role_filter_list = request.get(\'entity_role\', None)\n ...@@ -84,6 +83,8 @@ role_filter_list = request.get(\'entity_role\', None)\n
omit_balanced_accounts = request[\'omit_balanced_accounts\']\n omit_balanced_accounts = request[\'omit_balanced_accounts\']\n
from_date = request.get(\'from_date\', None)\n from_date = request.get(\'from_date\', None)\n
\n \n
request.other[\'is_accounting_report\'] = True\n
\n
# role_filter_list == None means no filter on the role\n # role_filter_list == None means no filter on the role\n
if role_filter_list == [\'\'] :\n if role_filter_list == [\'\'] :\n
role_filter_list = None\n role_filter_list = None\n
...@@ -126,11 +127,17 @@ entity_columns = [\n ...@@ -126,11 +127,17 @@ entity_columns = [\n
# will tell wether this third party account is balanced or not.\n # will tell wether this third party account is balanced or not.\n
valid_node_uids = []\n valid_node_uids = []\n
if omit_balanced_accounts :\n if omit_balanced_accounts :\n
for account in portal.portal_categories.resolveCategory(\'account_type/asset/receivable\'\n for account in portal.portal_categories.resolveCategory(\n
).getAccountTypeRelatedValueList(strict_membership = 1, portal_type = "Account") :\n \'account_type/asset/receivable\'\n
).getAccountTypeRelatedValueList(\n
strict_membership=1,\n
portal_type=\'Account\'):\n
valid_node_uids.append(account.getUid())\n valid_node_uids.append(account.getUid())\n
for account in portal.portal_categories.resolveCategory(\'account_type/liability/payable\'\n for account in portal.portal_categories.resolveCategory(\n
).getAccountTypeRelatedValueList(strict_membership = 1, portal_type = "Account") :\n \'account_type/liability/payable\'\n
).getAccountTypeRelatedValueList(\n
strict_membership=1,\n
portal_type=\'Account\'):\n
valid_node_uids.append(account.getUid())\n valid_node_uids.append(account.getUid())\n
\n \n
if not params[\'hide_grouping\'] :\n if not params[\'hide_grouping\'] :\n
...@@ -142,12 +149,15 @@ for party in context.Account_zDistinctSectionList():\n ...@@ -142,12 +149,15 @@ for party in context.Account_zDistinctSectionList():\n
if role_filter_list and o.getProperty(\'role\', []) not in role_filter_list:\n if role_filter_list and o.getProperty(\'role\', []) not in role_filter_list:\n
continue\n continue\n
\n \n
if o.getPortalType() == \'Person\' or not o.isMemberOf(transaction_section_category):\n if o.getPortalType() == \'Person\' or\\\n
not o.isMemberOf(transaction_section_category):\n
# don\'t show entities belonging to the group we are reporting\n # don\'t show entities belonging to the group we are reporting\n
if omit_balanced_accounts and (simulation_tool.getInventoryAssetPrice(\n if omit_balanced_accounts and (\n
mirror_section_uid=o.uid, node_uid = valid_node_uids, **params) == 0) :\n simulation_tool.getInventoryAssetPrice(\n
mirror_section_uid=o.uid,\n
node_uid=valid_node_uids, **params) == 0):\n
pass\n pass\n
else :\n else:\n
title = o.getTitle()\n title = o.getTitle()\n
if o.getProperty(\'role\', None):\n if o.getProperty(\'role\', None):\n
title += \' (%s)\' % o.getRoleTitle()\n title += \' (%s)\' % o.getRoleTitle()\n
...@@ -234,9 +244,10 @@ return result\n ...@@ -234,9 +244,10 @@ return result\n
<string>role_filter_list</string> <string>role_filter_list</string>
<string>omit_balanced_accounts</string> <string>omit_balanced_accounts</string>
<string>from_date</string> <string>from_date</string>
<string>True</string>
<string>_write_</string>
<string>result</string> <string>result</string>
<string>params</string> <string>params</string>
<string>_write_</string>
<string>portal</string> <string>portal</string>
<string>simulation_tool</string> <string>simulation_tool</string>
<string>entity_columns</string> <string>entity_columns</string>
......
...@@ -68,8 +68,7 @@ ...@@ -68,8 +68,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>""" Trial balance.\n
Trial balance.\n
"""\n """\n
from Products.ERP5Form.Report import ReportSection\n from Products.ERP5Form.Report import ReportSection\n
\n \n
...@@ -85,6 +84,8 @@ from_date = request.get(\'from_date\' , None)\n ...@@ -85,6 +84,8 @@ from_date = request.get(\'from_date\' , None)\n
expand_accounts = request.get(\'expand_accounts\' , False)\n expand_accounts = request.get(\'expand_accounts\' , False)\n
show_parent_accounts = request.get(\'show_parent_accounts\', False)\n show_parent_accounts = request.get(\'show_parent_accounts\', False)\n
\n \n
request.other[\'is_accounting_report\'] = True\n
\n
# flat_mode is a boolean that indicate wether we should use a report tree\n # flat_mode is a boolean that indicate wether we should use a report tree\n
# or a flat list of all accounts.\n # or a flat list of all accounts.\n
if request.get(\'tree_mode\', False):\n if request.get(\'tree_mode\', False):\n
...@@ -209,8 +210,9 @@ return result\n ...@@ -209,8 +210,9 @@ return result\n
<string>False</string> <string>False</string>
<string>expand_accounts</string> <string>expand_accounts</string>
<string>show_parent_accounts</string> <string>show_parent_accounts</string>
<string>result</string>
<string>True</string> <string>True</string>
<string>_write_</string>
<string>result</string>
<string>params</string> <string>params</string>
<string>balance_columns</string> <string>balance_columns</string>
</tuple> </tuple>
......
22 23
\ 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