Commit 10071e19 authored by Tomáš Peterka's avatar Tomáš Peterka

[erp5_accounting] Replace unserializable `selection` for `selection_name` in stat scripts

parent ca4256e4
"""Total credit of all accounting transactions having this """Total credit of all accounting transactions having this
account as node account as a node
""" """
kw['node_uid'] = context.getUid() kw.update(
kw['omit_asset_increase'] = 1 node_uid = context.getUid(),
kw.update(kw['selection'].getParams()) omit_asset_increase = 1,
)
kw.update(
**context.getPortalObject().portal_selections.getSelectionParamsFor(selection_name))
# here, or 0 is to prevent displaying "- 0" # here, or 0 is to prevent displaying "- 0"
return - context.Node_statAccountingBalance(**kw) or 0 return - context.Node_statAccountingBalance(**kw) or 0
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>**kw</string> </value> <value> <string>selection_name, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
"""Total debit of all accounting transactions having this """Total debit of all accounting transactions having this
account as a node account as a node
""" """
kw['node_uid'] = context.getUid()
kw['omit_asset_decrease'] = 1 kw.update(
kw.update(kw['selection'].getParams()) node_uid=context.getUid(),
omit_asset_decrease=1
)
# force second update to overwrite anything by selection params
kw.update(
**context.getPortalObject().portal_selections.getSelectionParamsFor(selection_name, REQUEST=kw.get('REQUEST', None)))
return context.Node_statAccountingBalance(**kw) return context.Node_statAccountingBalance(**kw)
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>**kw</string> </value> <value> <string>selection_name, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -5,7 +5,9 @@ kw['payment_uid'] = context.getUid() ...@@ -5,7 +5,9 @@ kw['payment_uid'] = context.getUid()
kw['omit_asset_increase'] = 1 kw['omit_asset_increase'] = 1
kw['asset_price'] = False kw['asset_price'] = False
kw['node_category'] = 'account_type/asset/cash/bank' kw['node_category'] = 'account_type/asset/cash/bank'
kw.update(kw['selection'].getParams()) kw.update(
**context.getPortalObject().portal_selections.getSelectionParamsFor(selection_name, REQUEST=kw.get('REQUEST', None)))
# here, or 0 is to prevent displaying "- 0" # here, or 0 is to prevent displaying "- 0"
return - context.Node_statAccountingBalance(**kw) or 0 return - context.Node_statAccountingBalance(**kw) or 0
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>**kw</string> </value> <value> <string>selection_name, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -5,6 +5,8 @@ kw['payment_uid'] = context.getUid() ...@@ -5,6 +5,8 @@ kw['payment_uid'] = context.getUid()
kw['omit_asset_decrease'] = 1 kw['omit_asset_decrease'] = 1
kw['asset_price'] = False kw['asset_price'] = False
kw['node_category'] = 'account_type/asset/cash/bank' kw['node_category'] = 'account_type/asset/cash/bank'
kw.update(kw['selection'].getParams())
kw.update(
**context.getPortalObject().portal_selections.getSelectionParamsFor(selection_name, REQUEST=kw.get('REQUEST', None)))
return context.Node_statAccountingBalance(**kw) return context.Node_statAccountingBalance(**kw)
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>**kw</string> </value> <value> <string>selection_name, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -6,7 +6,8 @@ kw['mirror_section_uid'] = context.getUid() ...@@ -6,7 +6,8 @@ kw['mirror_section_uid'] = context.getUid()
kw['omit_asset_increase'] = 1 kw['omit_asset_increase'] = 1
kw['node_category_strict_membership'] = ['account_type/asset/receivable', kw['node_category_strict_membership'] = ['account_type/asset/receivable',
'account_type/liability/payable'] 'account_type/liability/payable']
kw.update(kw['selection'].getParams()) kw.update(
**context.getPortalObject().portal_selections.getSelectionParamsFor(selection_name, REQUEST=kw.get('REQUEST', None)))
# here, or 0 is to prevent displaying "- 0" # here, or 0 is to prevent displaying "- 0"
return - context.Node_statAccountingBalance(**kw) or 0 return - context.Node_statAccountingBalance(**kw) or 0
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>**kw</string> </value> <value> <string>selection_name, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -5,6 +5,8 @@ kw['mirror_section_uid'] = context.getUid() ...@@ -5,6 +5,8 @@ kw['mirror_section_uid'] = context.getUid()
kw['omit_asset_decrease'] = 1 kw['omit_asset_decrease'] = 1
kw['node_category_strict_membership'] = ['account_type/asset/receivable', kw['node_category_strict_membership'] = ['account_type/asset/receivable',
'account_type/liability/payable'] 'account_type/liability/payable']
kw.update(kw['selection'].getParams()) kw.update(
**context.getPortalObject().portal_selections.getSelectionParamsFor(selection_name, REQUEST=kw.get('REQUEST', None)))
return context.Node_statAccountingBalance(**kw) return context.Node_statAccountingBalance(**kw)
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>**kw</string> </value> <value> <string>selection_name, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <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