diff --git a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_checkAggregateStockList.py b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_checkAggregateStockList.py index b151d452cc8d8c1871c24128d79c14ec6cc086e8..30d4fe006242ce49dbbc8ebf7676d306cdcf8d17 100644 --- a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_checkAggregateStockList.py +++ b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/CheckbookDelivery_checkAggregateStockList.py @@ -1,9 +1,13 @@ 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: diff --git a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Delivery_getCheckbookList.py b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Delivery_getCheckbookList.py index 0012b98dafefd5656ca43ab7976a57ab74698149..c21eba48e7a7406d6bd1c9d7ae4fbd78b4b8d405 100644 --- a/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Delivery_getCheckbookList.py +++ b/bt5/erp5_banking_check/SkinTemplateItem/portal_skins/erp5_banking_check_operation/Delivery_getCheckbookList.py @@ -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: diff --git a/bt5/erp5_banking_check/bt/dependency_list b/bt5/erp5_banking_check/bt/dependency_list index d3081054cc26ab9535ab43c2f4654f27c35e303b..cbd2eea05df53d539e435c7b057cf77cf3fd7fca 100644 --- a/bt5/erp5_banking_check/bt/dependency_list +++ b/bt5/erp5_banking_check/bt/dependency_list @@ -1 +1,2 @@ -erp5_banking_core \ No newline at end of file +erp5_banking_core +erp5_item diff --git a/product/ERP5Banking/tests/TestERP5BankingMixin.py b/product/ERP5Banking/tests/TestERP5BankingMixin.py index a56eb899c313a99b60b5bdb49492c663eaac301e..51b9ab5dbe853ba29f292586cc08f28346a241f3 100644 --- a/product/ERP5Banking/tests/TestERP5BankingMixin.py +++ b/product/ERP5Banking/tests/TestERP5BankingMixin.py @@ -54,6 +54,7 @@ class TestERP5BankingMixin(ERP5TypeTestCase): 'erp5_base', 'erp5_pdm', 'erp5_trade', + 'erp5_item', 'erp5_accounting', 'erp5_banking_core', 'erp5_banking_inventory',