Commit 6aebd89f authored by Jérome Perrin's avatar Jérome Perrin

Use getPortalResourceTypeList to know portal types that can be used as a resource

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15392 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a7175b5b
......@@ -205,12 +205,17 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
This will return all Products that have set product_line=\'shipping\'.\n
This will return all Products that have set product_line=\'shipping\'. XXX\n
Such products are used for shipping purposes i.e. they can not be sold.\n
"""\n
portal = context.getPortalObject()\n
\n
result = [r.getObject() for r in context.portal_catalog(portal_type=\'Product\')]\n
return [o for o in result if o.getProductLine() in (\'shipping\',)]\n
# XXX hardcoded category\n
shipping_product_line_category_uid = portal.portal_categories.product_line.shipping.getUid()\n
\n
return [r.getObject() for r in portal.portal_catalog(\n
product_line_uid=shipping_product_line_category_uid,\n
portal_type=portal.getPortalResourceTypeList())]\n
</string> </value>
</item>
<item>
......@@ -262,14 +267,14 @@ return [o for o in result if o.getProductLine() in (\'shipping\',)]\n
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>shipping_product_line_category_uid</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>context</string>
<string>r</string>
<string>result</string>
<string>o</string>
</tuple>
</value>
</item>
......
89
\ No newline at end of file
90
\ No newline at end of file
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