Commit f6935cb8 by Vincent Pelletier

erp5_banking_check: More *_expression removal

Add dependency on erp5_item to get now-required related keys.
parent 6bb4c56e
from Products.DCWorkflow.DCWorkflow import ValidationFailed
from Products.ERP5Type.Message import Message
aggregate_uid_list = [x.uid for x in context.portal_simulation.getCurrentTrackingList(
at_date=at_date, node=node_url,
where_expression="item_catalog.portal_type IN ('Check', 'Checkbook')")]
aggregate_uid_list = [
x.uid for x in context.portal_simulation.getCurrentTrackingList(
at_date=at_date,
node=node_url,
item_catalog_portal_type=('Check', 'Checkbook'),
)
]
for line in context.getMovementList():
for aggregate_value in line.getAggregateValueList():
if aggregate_value.getUid() not in aggregate_uid_list:
......
......@@ -32,11 +32,12 @@ if listbox is None:
listbox = []
if node is not None or disable_node:
getCurrentTrackingList = context.portal_simulation.getCurrentTrackingList
# context.log('Delivery_viewCheckbookInputDialog', getCurrentTrackingList(at_date=at_date, node=node,src__=1,where_expression="item_catalog.portal_type='Check' or item_catalog.portal_type='Checkbook'"))
if disable_node:
node=None
kw = {}
kw = {
'item_catalog_portal_type': ('Check', 'Checkbook'),
}
if reference not in (None, ''):
kw['aggregate_uid'] = [x.uid for x in context.getPortalObject().portal_catalog(
destination_payment_internal_bank_account_number=reference,
......@@ -47,17 +48,12 @@ if listbox is None:
checkbook_model_uid = context.getPortalObject().restrictedTraverse(checkbook_model).getUid()
kw['resource_uid'] = checkbook_model_uid
search_criterion = ''
if title not in (None, ''):
# FIXME: this doesn't work with current catalog and simulation tool
# build a SQL statement to bypass this limitation
#kw['item_catalog.title'] = title
search_criterion = " AND item_catalog.title LIKE '%s'" % title
kw['item_catalog_title'] = title
current_tracking_list = getCurrentTrackingList(
to_date=at_date,
node=node,
where_expression="item_catalog.portal_type='Check' or item_catalog.portal_type='Checkbook' %s" % search_criterion,
**kw)
if count is True:
......
erp5_banking_core
\ No newline at end of file
erp5_banking_core
erp5_item
......@@ -54,6 +54,7 @@ class TestERP5BankingMixin(ERP5TypeTestCase):
'erp5_base',
'erp5_pdm',
'erp5_trade',
'erp5_item',
'erp5_accounting',
'erp5_banking_core',
'erp5_banking_inventory',
......
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 sign in to comment