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