Commit 368c536d authored by Georgios Dagkakis's avatar Georgios Dagkakis

erp5_payment_mean: add 'ledger' domain tree to PaymentTransactionGroup_view

parent 0254eb66
count, _ = context.PaymentTransactionGroup_getPaymentTransactionLineCountAndStat() count, _ = context.PaymentTransactionGroup_getPaymentTransactionLineCountAndStat(kw.get('selection_name'))
return ((count, ), ) return ((count, ), )
...@@ -4,6 +4,7 @@ cache_key = context.getId() + '_' + script.id ...@@ -4,6 +4,7 @@ cache_key = context.getId() + '_' + script.id
try: try:
return cache[cache_key] return cache[cache_key]
except KeyError: except KeyError:
params = {'selection_domain': context.portal_selections.getSelectionDomainDictFor(selection_name)} if selection_name else {}
row, = portal.portal_simulation.getInventoryList( row, = portal.portal_simulation.getInventoryList(
select_dict={'count': 'COUNT(*)'}, select_dict={'count': 'COUNT(*)'},
ignore_group_by=1, ignore_group_by=1,
...@@ -13,6 +14,7 @@ except KeyError: ...@@ -13,6 +14,7 @@ except KeyError:
portal_type='Account', portal_type='Account',
strict_account_type_uid=portal.portal_categories.account_type.asset.cash.bank.getUid(), strict_account_type_uid=portal.portal_categories.account_type.asset.cash.bank.getUid(),
)], )],
**params
) )
cache[cache_key] = result = (row.count, row.total_quantity) cache[cache_key] = result = (row.count, row.total_quantity)
return result return result
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>selection_name=None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
portal = context.getPortalObject() portal = context.getPortalObject()
kw.update({ kw['section_uid'] = context.getSourceSectionUid()
'parent_portal_type':'Payment Transaction', kw['default_aggregate_uid'] = context.getUid()
'section_uid':context.getSourceSectionUid(), kw['parent_portal_type'] = ('Payment Transaction', 'Accounting Transaction')
'default_aggregate_uid':context.getUid(),
})
if context.getSourcePayment(): if context.getSourcePayment():
precision = context.getQuantityPrecisionFromResource( precision = context.getQuantityPrecisionFromResource(
context.getSourcePaymentValue().getPriceCurrency()) context.getSourcePaymentValue().getPriceCurrency())
portal.REQUEST.set('precision', precision) portal.REQUEST.set('precision', precision)
return portal.portal_simulation.getMovementHistoryList(**kw) return portal.portal_simulation.getMovementHistoryList(**kw)
from Products.PythonScripts.standard import Object from Products.PythonScripts.standard import Object
_, total_quantity = context.PaymentTransactionGroup_getPaymentTransactionLineCountAndStat() _, total_quantity = context.PaymentTransactionGroup_getPaymentTransactionLineCountAndStat(kw.get('selection_name'))
return Object(total_quantity=total_quantity), return Object(total_quantity=total_quantity),
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
<list> <list>
<string>columns</string> <string>columns</string>
<string>count_method</string> <string>count_method</string>
<string>domain_root_list</string>
<string>domain_tree</string>
<string>list_method</string> <string>list_method</string>
<string>selection_name</string> <string>selection_name</string>
<string>stat_method</string> <string>stat_method</string>
...@@ -124,6 +126,10 @@ ...@@ -124,6 +126,10 @@
<string>total_quantity</string> <string>total_quantity</string>
<string>Quantity</string> <string>Quantity</string>
</tuple> </tuple>
<tuple>
<string>ledger_translated_title</string>
<string>Ledger</string>
</tuple>
<tuple> <tuple>
<string>getTranslatedSimulationStateTitle</string> <string>getTranslatedSimulationStateTitle</string>
<string>State</string> <string>State</string>
...@@ -141,6 +147,21 @@ ...@@ -141,6 +147,21 @@
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>ledger</string>
<string>Ledger</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>domain_tree</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_view_mode_listbox</string> </value> <value> <string>my_view_mode_listbox</string> </value>
......
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