diff --git a/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSection_getProductList.xml b/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSection_getProductList.xml index c283cd64178b4b023590cd80548b451cf05ac174..beea0a48d506c61d40ae0d810c7c331b7ae36e28 100644 --- a/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSection_getProductList.xml +++ b/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSection_getProductList.xml @@ -55,23 +55,11 @@ <key> <string>_body</string> </key> <value> <string>#TODO : USE CACHE\n #the goal of this script is to get all the related product of this section\n -\n current_web_section = context.REQUEST.get(\'current_web_section\', context)\n product_list = []\n -\n kw[\'portal_type\'] = \'Product\'\n kw[\'limit\'] = limit\n -if current_web_section.getMembershipCriterionCategoryList() in (None, []) and current_web_section.getCriterionList() in (None, []):\n - kw[\'product_line_uid\'] = context.REQUEST.get(\'current_web_site\').getLayoutProperty(\'ecommerce_base_product_line\', \'\')\n -\n -product_list = current_web_section.WebSection_getDocumentValueListBase(all_versions=1,\n - all_languages=1,\n - **kw)\n -product_list = [x.getObject() for x in product_list if x.getPortalType() == \'Product\']\n -\n -# this step will be remove after have find a good way to improve WebSection_getDocumentValueListBase\n -# or find another base script for get only product direclty\n -\n +product_list = current_web_section.getDocumentValueList(all_versions=1, all_languages=1, **kw)\n return product_list\n </string> </value> </item> @@ -133,12 +121,7 @@ return product_list\n <string>current_web_section</string> <string>product_list</string> <string>_write_</string> - <string>None</string> <string>_apply_</string> - <string>append</string> - <string>$append0</string> - <string>_getiter_</string> - <string>x</string> </tuple> </value> </item> diff --git a/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSite_getProductList.xml b/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSite_getProductList.xml index d74557a6271aa45b01739be91cb267dc9ba9fa39..40bba6c6a9456664063af9231f562616d15620ee 100644 --- a/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSite_getProductList.xml +++ b/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce_widget_library/WebSite_getProductList.xml @@ -67,7 +67,7 @@ kw[\'limit\'] = limit\n \n # Getting all the products from all the visible Web Section.\n for web_section in web_site.WebSite_getMainSectionList():\n - product_list.extend([x.getObject() for x in web_section.getDocumentValueList(all_versions=1, all_languages=1, **kw) if x.getObject() not in product_list])\n + product_list.extend([x.uid for x in web_section.getDocumentValueList(all_versions=1, all_languages=1, **kw) if x.uid not in product_list])\n \n if len(product_list) > limit:\n random_index_list = []\n @@ -75,7 +75,9 @@ if len(product_list) > limit:\n random_number = randrange(0, len(product_list))\n if random_number not in random_index_list:\n random_index_list.append(random_number)\n - product_list = [product_list[x] for x in random_index_list if product_list[x].getPortalType() == \'Product\']\n + product_list = [product_list[x] for x in random_index_list]\n +\n +product_list = context.portal_catalog(portal_type=\'Product\', uid=product_list)\n return product_list\n diff --git a/bt5/erp5_commerce/bt/revision b/bt5/erp5_commerce/bt/revision index 0947c3313659827e4a73ff591c1fdcbccf9ed12f..1a1f7f8270a4352d79f9cc9d01750cbe16e6e850 100644 --- a/bt5/erp5_commerce/bt/revision +++ b/bt5/erp5_commerce/bt/revision @@ -1 +1 @@ -188 \ No newline at end of file +190 \ No newline at end of file