Commit 6d4330cc authored by Jérome Perrin's avatar Jérome Perrin

Add support for project in other parties reports

Entity_stat scripts are also modified in a way similar to
http://git.erp5.org/gitweb/erp5.git?a=commit;h=ce47e4d80b9d30943794d7023da9858cbbd1046b
to properly use project parameter in stat columns
Signed-off-by: Aurel's avatarAurélien Calonne <aurel@nexedi.com>
parent cd042c49
......@@ -54,6 +54,7 @@
"""Client & vendors accounts.\n
"""\n
portal = context.portal_url.getPortalObject()\n
\n
from Products.ERP5Form.Report import ReportSection\n
\n
......@@ -65,13 +66,14 @@ role_filter_list = request.get(\'mirror_section_category_list\', None)\n
omit_balanced_accounts = request[\'omit_balanced_accounts\']\n
from_date = request.get(\'from_date\', None)\n
gap_root = request.get(\'gap_root\', None)\n
project = request.get(\'project\', None)\n
\n
request.other[\'is_accounting_report\'] = True\n
\n
# role_filter_list == None means no filter on the role\n
if role_filter_list == [\'\'] :\n
role_filter_list = None\n
\n
\n
section_uid = context.Base_getSectionUidListForSectionCategory(\n
request[\'section_category\'],\n
request[\'section_category_strict\'])\n
......@@ -89,7 +91,12 @@ if from_date:\n
else :\n
params[\'no_from_date\'] = 1\n
\n
portal = context.portal_url.getPortalObject()\n
if project:\n
if project == \'None\':\n
params[\'project_uid\'] = project\n
else:\n
params[\'project_uid\'] = portal.restrictedTraverse(project).getUid()\n
\n
simulation_tool = portal.portal_simulation\n
\n
entity_columns = [\n
......@@ -131,16 +138,13 @@ for party in context.Account_zDistinctSectionList(\n
not o.isMemberOf(section_category):\n
# don\'t show entities belonging to the group we are reporting\n
if omit_balanced_accounts and (\n
simulation_tool.getInventoryAssetPrice(\n
section_category=section_category,\n
at_date=at_date,\n
simulation_state=simulation_state,\n
round(simulation_tool.getInventoryAssetPrice(\n
mirror_section_uid=party.uid,\n
node_category_strict_membership=(\n
\'account_type/asset/receivable\',\n
\'account_type/liability/payable\'),\n
# TODO: don\'t compare floats for equality ...\n
) == 0.):\n
**params\n
), 3) == 0.):\n
pass\n
else:\n
title = o.getTitle()\n
......
......@@ -91,6 +91,7 @@
<list>
<string>your_section_category</string>
<string>your_currency</string>
<string>your_project</string>
<string>your_at_date</string>
<string>your_omit_balanced_accounts</string>
<string>your_omit_empty_accounts</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_project</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>your_project</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>AccountModule_viewReportFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -73,6 +73,7 @@
<list>
<string>your_section_category</string>
<string>your_section_category_strict</string>
<string>your_project</string>
<string>your_at_date</string>
<string>your_omit_balanced_accounts</string>
<string>your_omit_grouping_reference</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_project</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>your_project</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>AccountModule_viewDialogFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -53,10 +53,13 @@
<value> <string>"""Total credit of all accounting transactions having this\n
entity as a mirror section\n
"""\n
\n
kw[\'mirror_section_uid\'] = context.getUid()\n
kw[\'omit_asset_increase\'] = 1\n
kw[\'node_category_strict_membership\'] = [\'account_type/asset/receivable\',\n
\'account_type/liability/payable\']\n
kw.update(kw[\'selection\'].getParams())\n
\n
# here, or 0 is to prevent displaying "- 0"\n
return - context.Node_statAccountingBalance(**kw) or 0\n
</string> </value>
......
......@@ -57,6 +57,8 @@ kw[\'mirror_section_uid\'] = context.getUid()\n
kw[\'omit_asset_decrease\'] = 1\n
kw[\'node_category_strict_membership\'] = [\'account_type/asset/receivable\',\n
\'account_type/liability/payable\']\n
kw.update(kw[\'selection\'].getParams())\n
\n
return context.Node_statAccountingBalance(**kw)\n
</string> </value>
</item>
......
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