Commit 445109a5 authored by Tomáš Peterka's avatar Tomáš Peterka

[erp5_accounting] Update scripts related to reports to clearly specify their arguments

parent 77df1d1d
"""Returns Accounting Transactions where this account is node.
"""
kw['node_uid'] = context.getUid()
kw.update(dict(
# following one line is the reason for this whole script
node_uid=context.getUid(),
selection_name=selection_name,
omit_grouping_reference=omit_grouping_reference,
analytic_column_list=analytic_column_list, # used to be passed through REQUEST
node_category=node_category,
node_category_strict_membership=node_category_strict_membership,
mirror_section_category=mirror_section_category,
# from_date=from_date, # if added from_date terrible things start to happen
))
return context.Node_getAccountingTransactionList(**kw)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
<value> <string> node_category=None, node_category_strict_membership=None, mirror_section_category=None, omit_grouping_reference=None, selection_name=None, analytic_column_list=(), **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
"""Returns Accounting Transactions where this entity is mirror section.
"""
kw['mirror_section_uid'] = context.getUid()
kw['node_category_strict_membership'] = ['account_type/asset/receivable',
'account_type/liability/payable']
kw.update(dict(
# following two lines are the reason for this whole script to exist
mirror_section_uid=context.getUid(),
node_category_strict_membership=['account_type/asset/receivable', 'account_type/liability/payable'],
# omit_grouping_reference=omit_grouping_reference,
# the rest is only not to shadow which parameters are actually needed
sort_on=sort_on,
selection_name=selection_name,
))
return context.Node_getAccountingTransactionList(**kw)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
<value> <string>selection_name=\'\', sort_on=(), **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -9,8 +9,10 @@ else:
title = explanation.getTitle()
analytic_property_list = [explanation.getReference()]
if analytic_column_list is None:
analytic_column_list = request.get('analytic_column_list', ())
for property_name, property_title in request['analytic_column_list']: #pylint: disable=unused-variable
for property_name, property_title in analytic_column_list: #pylint: disable=unused-variable
# XXX it would be a little better to reuse editable field
if property_name == 'project':
analytic_property_list.append(brain.Movement_getProjectTitle())
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>brain, selection=None, **kwd</string> </value>
<value> <string>brain, selection=None, analytic_column_list=(), **kwd</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>brain=None, selection=None, **kw</string> </value>
<value> <string>brain, selection=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
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