diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_getOrderReportSectionList.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_getOrderReportSectionList.xml index 9e3f3a855d647f2bc4b62e55b865b334bdb531a9..3ab45c44c25392d9e00fbfa3b60c99b934a89612 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_getOrderReportSectionList.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_getOrderReportSectionList.xml @@ -69,13 +69,15 @@ selection_columns = [(\'group_by\', "Group by")]\n if from_date is None:\n # get the minimum start date in catalog\n from Products.ZSQLCatalog.SQLCatalog import Query, NegatedQuery\n - kw = {"delivery.start_date" : None}\n + kw = {"delivery.start_date" : None, "key":"DefaultKey"}\n q = NegatedQuery(Query(**kw)) \n select_expression = "MIN(delivery.start_date)"\n group_by = "delivery.start_date"\n from_date = DateTime(context.portal_catalog(select_expression=select_expression,\n group_by_expression=group_by,query=q,\n limit=1)[0][2])\n +\n + \n # get period list between given date\n interval_list_dict = getIntervalListBetweenDates(from_date=from_date, to_date=to_date,\n keys={\'year\':aggregation_level=="year",\n @@ -84,6 +86,7 @@ interval_list_dict = getIntervalListBetweenDates(from_date=from_date, to_date=to \'day\':aggregation_level=="day"})\n interval_list = interval_list_dict[aggregation_level]\n \n +# FIXME: translate column names\n # list columns of the listbox\n interval_column_list = []\n if group_by == "client":\n diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_getOrderStatList.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_getOrderStatList.xml index 323f552b0627e3d9f7f2acb4a0f6c5ebde2dc9ce..e81f8e5e7111b9143e59c56a824ed1dc6b96cc54 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_getOrderStatList.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_getOrderStatList.xml @@ -79,10 +79,10 @@ if group not in (\'\', None):\n group_uid = category_tool.group.restrictedTraverse(group).getUid()\n organisation_uid_list = [x.uid for x in portal.portal_catalog(portal_type="Organisation", default_group_uid=group_uid)]\n if report_type == "sale":\n - catalog_params[\'default_source_section_uid\'] = organisation_uid_list\n + catalog_params[\'default_source_section_uid\'] = organisation_uid_list or -1\n elif report_type:\n - catalog_params[\'default_destination_section_uid\'] = organisation_uid_list\n - \n + catalog_params[\'default_destination_section_uid\'] = organisation_uid_list or -1\n +\n # add category params if defined\n if incoterm not in (\'\', None):\n incoterm_uid = category_tool.incoterm.restrictedTraverse(incoterm).getUid()\n @@ -117,6 +117,7 @@ elif to_date is not None:\n query = Query(range="ngt", **params)\n \n sort_on_list = [ (\'delivery.destination_section_uid\', \'ASC\'), (\'delivery.start_date\',\'ASC\')]\n +\n result_list = context.portal_catalog.searchResults(limit=None,query=query,\n portal_type=doc_portal_type,\n simulation_state=simulation_state,\n @@ -130,7 +131,9 @@ client_dict = {}\n product_dict = {}\n for result in result_list:\n result = result.getObject()\n - period = result.getStartDate().strftime(date_format)\n + period = result.getStartDate()\n + if period is not None:\n + period = period.strftime(date_format)\n if report_group_by in ("client", "both"):\n # client_title -> period -> amount\n if report_type == "sale":\n diff --git a/bt5/erp5_trade/bt/revision b/bt5/erp5_trade/bt/revision index 5aac26524c8e01c197717bef65b9fc335c90c47c..a9ba1259cffcec623e16c1da4d1a05e47aad1015 100644 --- a/bt5/erp5_trade/bt/revision +++ b/bt5/erp5_trade/bt/revision @@ -1 +1 @@ -606 \ No newline at end of file +607 \ No newline at end of file