Commit d2d55f54 authored by Jean-Paul Smets's avatar Jean-Paul Smets Committed by Xiaowu Zhang

erp5_commerce_related

parent b928e3e4
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_web_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_web_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>web_view</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>0.9</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Web View</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SaleOrderModule_viewAsWebSaleOrderList</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: object is not None and object.isWebMode() and not object.isEditableMode()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_web_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_web_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>web_view</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>0.9</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Web View</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SaleOrder_viewDetailAsWeb</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: object is not None and object.isWebMode() and not object.isEditableMode()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -7,4 +7,12 @@ ...@@ -7,4 +7,12 @@
<type>Product</type> <type>Product</type>
<workflow>-validation_workflow, commerce_validation_workflow</workflow> <workflow>-validation_workflow, commerce_validation_workflow</workflow>
</chain> </chain>
<chain>
<type>Sale Trade Condition</type>
<workflow>-validation_workflow, commerce_validation_workflow</workflow>
</chain>
<chain>
<type>Service</type>
<workflow>-validation_workflow, commerce_validation_workflow</workflow>
</chain>
</workflow_chain> </workflow_chain>
\ No newline at end of file
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>"""\n
Generate random id which is generally used as a session ID.\n Generate random ID which is generally used as a session ID\n
"""\n """\n
from random import choice\n from random import choice\n
import string\n import string\n
......
...@@ -50,13 +50,24 @@ ...@@ -50,13 +50,24 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># Only save basic personal information for an ecommerce website\n <value> <string>"""\n
Edit the personal information of a client through specific form\n
which takes into account only basic personal information \n
\n
TODO:\n
- handle form validation errors after the call to\n
Base_edit (not the case currently)\n
\n
BUG:\n
- make sure personal address can be updated from\n
account page (no the case currently)\n
"""\n
translateString = context.Base_translateString \n translateString = context.Base_translateString \n
\n \n
context.Base_edit(form_id=\'Person_viewAsWeb\')\n context.Base_edit(form_id=\'Person_viewAsWeb\')\n
\n \n
context.ERP5Site_redirect(\'%s/account\' % context.getWebSiteValue().absolute_url(), \\\n context.ERP5Site_redirect(\'%s/account\' % context.getWebSiteValue().absolute_url(), \\\n
keep_items={\'portal_status_message\': translateString("Your personal informations are updated.", mapping = dict())})\n keep_items={\'portal_status_message\': translateString("Your personal informations are now updated.", mapping = dict())})\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -67,6 +78,10 @@ context.ERP5Site_redirect(\'%s/account\' % context.getWebSiteValue().absolute_ur ...@@ -67,6 +78,10 @@ context.ERP5Site_redirect(\'%s/account\' % context.getWebSiteValue().absolute_ur
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Person_editPersonalInformation</string> </value> <value> <string>Person_editPersonalInformation</string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string>Edit customer information</string> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
...@@ -187,11 +187,10 @@ ...@@ -187,11 +187,10 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>"""\n
This script is a sceleton for implementing discounts per customer basis.\n This script is a skeleton for implementing discounts per customer basis.\n
Because it\'s specific for every shop it needs to be implemented accordingly. \n Because it\'s specific for every shop it needs to be implemented accordingly. \n
See also SaleOrder_viewDiscountRenderer. \n See also SaleOrder_viewDiscountRenderer.\n
"""\n """\n
\n
return None\n return None\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -187,16 +187,28 @@ ...@@ -187,16 +187,28 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>"""\n
This script will find applicable taxes for customer based on his/hers location.\n This script will find applicable taxes for customer based on his/her location.\n
For example.\n For example.\n
- B2B in EU in same country, tax \n - B2B in EU in same country, VAT applicable \n
- B2B in EU in different country, no tax \n - B2B in EU in different country, no VAT applicable \n
- B2B and B2P from EU to outside EU, no tax \n - B2B and B2C from EU to outside EU, no VAT applicable\n
- B2P in EU, tax\n - B2C in EU, VAT applicable\n
\n
TODO:\n
- use same keys as in ERP5 propertysheets (ex. ratio instead of percent)\n
- should become Resource_getApplicableTaxList and use the tax generation\n
model of ERP5 instead of ad-hoc one, maybe with some optimizations for\n
high performance price display. There is no reason to handle price\n
and tax in a different way.\n
\n
BUG:\n
- some shops are "tax inclusive" which is not currently possible and\n
prevents B2C ecommerce. Tax inclusive requires business model\n
requires a different kind of simulation rules and trade models.\n
"""\n """\n
\n \n
return {\'VAT\': {\'translated_title\':context.Base_translateString(\'VAT\'),\n return {\'VAT\': {\'translated_title\':context.Base_translateString(\'VAT\'),\n
\'percent\': 20.,\n \'percent\': 19.6,\n
},\n },\n
}\n }\n
</string> </value> </string> </value>
......
...@@ -50,16 +50,32 @@ ...@@ -50,16 +50,32 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>"""\n
Tries to find a Web Page related to the current Product\n
with publication section set to "website/product/short_description"\n
\n \n
#get cached description\n This short description made of HTML can be used to provide\n
# TODO\n a better description than the one provided by default on\n
the product.\n
\n \n
#get live description\n TODO:\n
- use cache for description\n
- remove hardcoding by using site properties\n
- make sure we can include javascript in HTML\n
of web pages (a generic requirement which will lead\n
to changes in ERP5 TextDocument class)\n
- Rename to Resource_... since this script also\n
applied to services\n
- Handle language and version selection, possibily predicate\n
just like WebSection\n
- rename to use asHTML terminology\n
"""\n
portal = context.getPortalObject()\n
\n
# Find a related web page with appropriate publication_section\n
web_page = portal.portal_catalog(portal_type=\'Web Page\',\n web_page = portal.portal_catalog(portal_type=\'Web Page\',\n
default_follow_up_uid=context.getUid(),\n default_follow_up_uid=context.getUid(),\n
default_publication_section_uid=context.restrictedTraverse(\'portal_categories/publication_section/website/product/short_description\').getUid(),\n default_publication_section_uid=context.restrictedTraverse(\'portal_categories/publication_section/website/product/short_description\').getUid(), # XXX Bad hardcoding\n
#src__=1,\n
)\n )\n
if web_page is None or len(web_page) == 0:\n if web_page is None or len(web_page) == 0:\n
return context.Base_translateString("No more information for this product.")\n return context.Base_translateString("No more information for this product.")\n
...@@ -74,6 +90,10 @@ return web_page[0].getObject().asStrippedHTML()\n ...@@ -74,6 +90,10 @@ return web_page[0].getObject().asStrippedHTML()\n
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Product_getRelatedDescription</string> </value> <value> <string>Product_getRelatedDescription</string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string>Get product description</string> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
...@@ -54,6 +54,14 @@ ...@@ -54,6 +54,14 @@
"""\n """\n
Add resource to shopping cart.\n Add resource to shopping cart.\n
\n
TODO:\n
- support generic variations beyond size and variation\n
(through introspection of resource) also in\n
SaleOrder_viewShoppingCartRenderer and\n
SaleOrder_viewShoppingCartWidgetRenderer\n
- implement form validation and parameter retrieval using Base_edit\n
- Resource_viewAsShop should be select through portal types\n
"""\n """\n
request = container.REQUEST\n request = container.REQUEST\n
if resource is None:\n if resource is None:\n
...@@ -64,7 +72,7 @@ if form_id is not None:\n ...@@ -64,7 +72,7 @@ if form_id is not None:\n
form = getattr(context, form_id, None)\n form = getattr(context, form_id, None)\n
quantity = int(request.get(\'field_your_buy_quantity\'))\n quantity = int(request.get(\'field_your_buy_quantity\'))\n
# FIXME:\n # FIXME:\n
# this handling of validation errors should be automatically handled by the \n # this handling of validation errors should be automatically handled by the\n
# button itself\n # button itself\n
try:\n try:\n
params = form.validate_all_to_request(request)\n params = form.validate_all_to_request(request)\n
...@@ -84,31 +92,45 @@ if form_id is not None:\n ...@@ -84,31 +92,45 @@ if form_id is not None:\n
shopping_cart = context.SaleOrder_getShoppingCart()\n shopping_cart = context.SaleOrder_getShoppingCart()\n
shopping_cart_items = context.SaleOrder_getShoppingCartItemList()\n shopping_cart_items = context.SaleOrder_getShoppingCartItemList()\n
\n \n
# Add-hoc access to parameters (use instead Base_edit)\n
# and quick dirty hack\n
# XXX - This must be rewritten to support any variation dimensions\n
# (not only size and variation)\n
size = request.form.get(\'field_variation_box_your_size\', \'\')\n
variation = request.form.get(\'field_variation_box_your_variation\', None)\n
\n
## check if we don\'t have already such a resource in cart\n ## check if we don\'t have already such a resource in cart\n
line_found=False\n line_found=False\n
for order_line in shopping_cart_items:\n for order_line in shopping_cart_items:\n
if order_line.getResource() == resource.getRelativeUrl():\n if order_line.getResource() == resource.getRelativeUrl():\n
new_quantity = int(order_line.getQuantity()) + quantity\n if (not variation or order_line.getVariation() == variation)\\\n
if new_quantity <= 0:\n and (not size or order_line.getSize() == size):\n
## remove items with zero quantity\n new_quantity = int(order_line.getQuantity()) + quantity\n
shopping_cart.manage_delObjects(order_line)\n if new_quantity <= 0:\n
else:\n ## remove items with zero quantity\n
order_line.setQuantity(new_quantity)\n shopping_cart.manage_delObjects(order_line)\n
line_found=True\n else:\n
break\n order_line.setQuantity(new_quantity)\n
line_found=True\n
break\n
\n \n
if line_found == False:\n if not line_found:\n
## new Resource so add it to shopping cart\n ## new Resource so add it to shopping cart\n
order_line = shopping_cart.newContent(portal_type=\'Sale Order Line\')\n order_line = shopping_cart.newContent(portal_type=\'Sale Order Line\')\n
order_line.setResource(resource.getRelativeUrl())\n order_line.setResource(resource.getRelativeUrl())\n
order_line.setQuantity(quantity)\n order_line.setQuantity(quantity)\n
if variation: order_line.setVariation(variation)\n
if size: order_line.setSize(size)\n
order_line.setPrice(context.getPrice(context=order_line))\n
\n \n
if( context.getPortalType() == \'Product\'):\n if( context.getPortalType() == \'Product\'):\n
context.Base_redirect(\'Resource_viewAsShop\',\n context.Base_redirect(\'Resource_viewAsShop\',\n
keep_items={\'portal_status_message\':context.Base_translateString("Added to cart.")})\n keep_items={\'portal_status_message\':context.Base_translateString("Added to cart."),\n
\'variation\':variation})\n
else:\n else:\n
context.Base_redirect(\'view\',\n context.Base_redirect(\'view\',\n
keep_items={\'portal_status_message\':context.Base_translateString("Added to cart.")})\n keep_items={\'portal_status_message\':context.Base_translateString("Added to cart."),\n
\'variation\':variation})\n
]]></string> </value> ]]></string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Create a temporary movement with properties and categories\n
needed to provide a default price for a given resource\n
\n
TODO:\n
- add support to input parameters (**kw) so that it\n
is possible specialize price calculation\n
"""\n
from Products.ERP5Type.Document import newTempMovement\n
\n
# Try to find out the current web site\n
web_site_value = context.REQUEST.get(\'current_web_site\', None)\n
if web_site_value is None:\n
web_site_value = context.getWebSiteValue() \n
if web_site_value is None:\n
raise ValueError("Could not determine the current web site to compute default currency of price")\n
\n
# If this resource is variated, initialize the default\n
# variation context\n
variation_dict = {}\n
if len(context.getVariationRangeCategoryList()):\n
request = context.REQUEST\n
# Set each category of variation either to the default value\n
# or to the value provided by the REQUEST object\n
for variation_base_category in context.getVariationBaseCategoryList():\n
default_variation = context.getVariationCategoryList(base_category_list=[variation_base_category])\n
# circumvent inconsistency for individual variations\n
default_variation = default_variation or \\\n
context.getVariationRangeCategoryList(base_category_list=[variation_base_category])\n
if len(default_variation):\n
default_variation = default_variation[0]\n
variation_category = request.get(variation_base_category, default_variation)\n
variation_dict[variation_base_category] = variation_category\n
\n
movement = newTempMovement(context, "temp_pricing_movement", resource_value=context,\n
price_currency_value=web_site_value.WebSite_getShoppingCartDefaultCurrency(),\n
**variation_dict)\n
return movement\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Resource_getPriceCalculationDefaultContext</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Build movement context to compute price</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -188,8 +188,11 @@ ...@@ -188,8 +188,11 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>"""\n
Delete a shopping cart item.\n Delete a shopping cart item.\n
"""\n
\n \n
TODO:\n
- use form validation (Base_edit)\n
- use \'form_id\' instead of hardcoded value \'SaleOrder_viewAsWeb\'\n
"""\n
translateString = context.Base_translateString\n translateString = context.Base_translateString\n
shopping_cart = context.SaleOrder_getShoppingCart()\n shopping_cart = context.SaleOrder_getShoppingCart()\n
\n \n
......
...@@ -189,10 +189,14 @@ ...@@ -189,10 +189,14 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
"""\n """\n
Update shopping cart by change items quantity and setting preferred \n Update shopping cart by changing item quantities and by setting preferred\n
shipping.\n shipping method and payment method.\n
"""\n
\n \n
TODO:\n
- support modern payment conditions (instead of payment_mode)\n
- use Base_edit and a real ERP5 Form in order to benefit from\n
field reusability and property validation\n
"""\n
request = context.REQUEST\n request = context.REQUEST\n
translateString = context.Base_translateString \n translateString = context.Base_translateString \n
quantity = field_my_buy_quantity\n quantity = field_my_buy_quantity\n
...@@ -201,10 +205,10 @@ shopping_cart_items = context.SaleOrder_getShoppingCartItemList(include_shipping ...@@ -201,10 +205,10 @@ shopping_cart_items = context.SaleOrder_getShoppingCartItemList(include_shipping
shopping_cart_products_items = filter(lambda x: x.getId()!=\'shipping_method\', shopping_cart_items)\n shopping_cart_products_items = filter(lambda x: x.getId()!=\'shipping_method\', shopping_cart_items)\n
shopping_cart = context.SaleOrder_getShoppingCart()\n shopping_cart = context.SaleOrder_getShoppingCart()\n
\n \n
# handle change in quantity for shopping items\n # Handle change in quantity for shopping items\n
if quantity is not None:\n if quantity is not None:\n
# when we have one item in shoppping cart we get \n # Whenever there is onlu one item in shoppping cart, quantity\n
# quantity as a string rather as a list\n # is a string rather as a list\n
if isinstance(quantity, str):\n if isinstance(quantity, str):\n
quantity = [quantity]\n quantity = [quantity]\n
\n \n
...@@ -214,11 +218,11 @@ if quantity is not None:\n ...@@ -214,11 +218,11 @@ if quantity is not None:\n
if new_quantity>=1:\n if new_quantity>=1:\n
order_line.setQuantity(new_quantity)\n order_line.setQuantity(new_quantity)\n
else:\n else:\n
# remove it from shopping cart\n # Remove it from shopping cart\n
shopping_cart.manage_delObjects(order_line.getId())\n shopping_cart.manage_delObjects(order_line.getId())\n
counter += 1\n counter += 1\n
\n \n
# handle shipping\n # Handle shipping\n
order_line = getattr(shopping_cart, \'shipping_method\', None)\n order_line = getattr(shopping_cart, \'shipping_method\', None)\n
if shipping_method not in [\'\', None]:\n if shipping_method not in [\'\', None]:\n
shipping = context.getPortalObject().restrictedTraverse(shipping_method)\n shipping = context.getPortalObject().restrictedTraverse(shipping_method)\n
...@@ -232,7 +236,11 @@ else:\n ...@@ -232,7 +236,11 @@ else:\n
if field_my_shipping_method in [\'\', None] and order_line is not None:\n if field_my_shipping_method in [\'\', None] and order_line is not None:\n
shopping_cart.manage_delObjects(order_line.getId())\n shopping_cart.manage_delObjects(order_line.getId())\n
\n \n
return context.SaleOrder_paymentRedirect(field_my_comment, field_my_payment_mode)\n # Handle payment mode and comment\n
shopping_cart.setComment(field_my_comment)\n
shopping_cart.setPaymentConditionPaymentMode(field_my_payment_mode) # XXX This is bad because it does not use trade conditions XXX\n
\n
return context.SaleOrder_paymentRedirect()\n
]]></string> </value> ]]></string> </value>
......
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>""" \n <value> <string>""" \n
This script is called by external payment system.\n This script is called by external payment system.\n
Here you can check if payment was successfull or not.\n It is possible to check here whether payment was successfull or not.\n
"""\n """\n
\n \n
# XXX: implement external payment check\n # XXX: implement external payment check\n
......
...@@ -187,8 +187,14 @@ ...@@ -187,8 +187,14 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>"""\n
Do whatever is necessary to finalize an order.\n Do whatever is necessary to finalize an order. This script\n
This script is called after customer completes shopping.\n is called after customer completes shopping (and payment).\n
\n
TODO:\n
- support generic variations\n
- rename buyer to supplier (everywhere)\n
- clean up python style such as space in "a = b" inside function calls\n
(hint: add global syntax and lexical analysis to ERP5 scripts)\n
"""\n """\n
from DateTime import DateTime\n from DateTime import DateTime\n
request = context.REQUEST\n request = context.REQUEST\n
...@@ -201,32 +207,33 @@ customer = shopping_cart.SaleOrder_getShoppingCartCustomer()\n ...@@ -201,32 +207,33 @@ customer = shopping_cart.SaleOrder_getShoppingCartCustomer()\n
buyer = shopping_cart.SaleOrder_getShoppingCartBuyer()\n buyer = shopping_cart.SaleOrder_getShoppingCartBuyer()\n
\n \n
if isAnon:\n if isAnon:\n
# create first an account for user\n # Create first an account for user\n
msg = translateString("You need to create an account to continue. If you already have please login.")\n msg = translateString("You need to create an account to continue. If you already have please login.")\n
web_site.Base_redirect(\'login_form\', \\\n web_site.Base_redirect(\'login_form\', \\\n
keep_items={\'portal_status_message\': msg})\n keep_items={\'portal_status_message\': msg})\n
return\n return\n
\n \n
#Check if payment is sucessfull\n # Check if payment is sucessfull (comment the if buyer line and uncoment the next to be able to test)\n
if buyer is None:\n if buyer is None:\n
raise ValueError, "Impossible to finalize and order not payed"\n # if False:\n
raise ValueError, "Impossible to finalize an order which was not payed before"\n
\n \n
portal_type = "Sale %s" % shopping_cart.getPortalType()\n portal_type = shopping_cart.getPortalType()\n
module = context.getDefaultModule(portal_type)\n module = context.getDefaultModule(portal_type)\n
sale_order = module.newContent(portal_type=portal_type,\n sale_order = module.newContent(portal_type=portal_type,\n
destination_value = customer,\n destination_value = customer,\n
destination_section_value = customer,\n destination_section_value = customer,\n
destination_decision_value = customer,\n destination_decision_value = customer,\n
source_section_value = buyer,\n source_section_value = buyer,\n
source_value = buyer,\n source_value = buyer,\n
start_date = DateTime(),\n start_date = DateTime(),\n
received_date = DateTime(),\n received_date = DateTime(),\n
comment = shopping_cart.getComment(),\n comment = shopping_cart.getComment(),\n
# set order default currency,\n # set order default currency,\n
default_price_currency = web_site.WebSite_getShoppingCartDefaultCurrency().getRelativeUrl(),\n default_price_currency = web_site.WebSite_getShoppingCartDefaultCurrency().getRelativeUrl(),\n
# set trade condition\n # set trade condition\n
specialise_value = web_site.SaleOrder_getDefaultTradeCondition()\n specialise_value = web_site.SaleOrder_getDefaultTradeCondition()\n
)\n )\n
\n \n
for order_line in shopping_cart_item_list:\n for order_line in shopping_cart_item_list:\n
resource = order_line.getResourceValue()\n resource = order_line.getResourceValue()\n
...@@ -235,14 +242,18 @@ for order_line in shopping_cart_item_list:\n ...@@ -235,14 +242,18 @@ for order_line in shopping_cart_item_list:\n
aggregate_list = order_line.getAggregateList(),\n aggregate_list = order_line.getAggregateList(),\n
quantity = order_line.getQuantity(),\n quantity = order_line.getQuantity(),\n
price = order_line.getPrice(),\n price = order_line.getPrice(),\n
title = resource.getTitle())\n title = resource.getTitle(),\n
variation=order_line.getVariation(),\n
size=order_line.getSize(),\n
)\n
\n \n
# order it\n # order it\n
sale_order.order()\n sale_order.activate().order()\n
\n \n
# clean up shopping cart\n # clean up shopping cart\n
context.SaleOrder_getShoppingCart(action=\'reset\')\n context.SaleOrder_getShoppingCart(action=\'reset\')\n
\n \n
# Display nice message\n
context.Base_redirect(\'SaleOrder_viewThankYouMessage\')\n context.Base_redirect(\'SaleOrder_viewThankYouMessage\')\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -187,8 +187,11 @@ ...@@ -187,8 +187,11 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>"""\n
This will return all Products that have set product_line=\'shipping\'. XXX\n This script return all Products which product_line category is set to \'shipping\'. \n
Such products are used for shipping purposes i.e. they can not be sold.\n Such products are used for shipping purposes i.e. they can not be sold.\n
\n
TODO:\n
- change hardcoded category from \'product_line\' to a site dependent category\n
"""\n """\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
\n \n
......
...@@ -50,7 +50,9 @@ ...@@ -50,7 +50,9 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""Return the default trade condition"""\n <value> <string>"""\n
Return the default trade condition for thie ecommerce site\n
"""\n
default = "sale_trade_condition_module/default_trade_condition"\n default = "sale_trade_condition_module/default_trade_condition"\n
\n \n
website = context.getWebSiteValue()\n website = context.getWebSiteValue()\n
...@@ -68,6 +70,10 @@ return context.getPortalObject().restrictedTraverse(default)\n ...@@ -68,6 +70,10 @@ return context.getPortalObject().restrictedTraverse(default)\n
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>SaleOrder_getDefaultTradeCondition</string> </value> <value> <string>SaleOrder_getDefaultTradeCondition</string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string>Return default trade condition</string> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
...@@ -50,7 +50,14 @@ ...@@ -50,7 +50,14 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>creation_date = context.getCreationDate()\n <value> <string>"""\n
Return the creation date of the current context with\n
a niceer format.\n
\n
TODO:\n
- use a field and form for this purpose\n
"""\n
creation_date = context.getCreationDate()\n
return creation_date.strftime(\'%a, %d %b %Y %H:%M %p\')\n return creation_date.strftime(\'%a, %d %b %Y %H:%M %p\')\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -50,7 +50,16 @@ ...@@ -50,7 +50,16 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>return \'%s %s\' %(context.getTotalPrice(), context.getPriceCurrencyTitle())\n <value> <string>"""\n
Return the price and currency, with some\n
ad-hoc pretty printing\n
\n
TODO:\n
- implement generic pretty printing of currencies\n
"""\n
price_currency_title = context.getPriceCurrencyTitle()\n
if price_currency_title == "Euro": price_currency_title = "€"\n
return \'%s %s\' %(context.getTotalPrice(), price_currency_title)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -186,7 +186,10 @@ ...@@ -186,7 +186,10 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>shopping_cart = context.SaleOrder_getShoppingCart()\n <value> <string>"""\n
Return selected shipping method from shopping cart\n
"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
shipping_method = getattr(shopping_cart, \'shipping_method\', None)\n shipping_method = getattr(shopping_cart, \'shipping_method\', None)\n
if shipping_method is not None:\n if shipping_method is not None:\n
return shipping_method.getResourceValue()\n return shipping_method.getResourceValue()\n
......
...@@ -50,8 +50,16 @@ ...@@ -50,8 +50,16 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>""" \n <value> <string>"""\n
Add resource to current (or to be created shopping cart). \n Create a new shopping cart if needed. Return\n
shopping cart for current customer. Set all local roles\n
permissins so that shopping cart can be modified by anonymous.\n
\n
TODO:\n
- handle reset with another method\n
(more explicit, less risky)\n
- decide whether to keep or remove new_shopping_cart parameter\n
(is it really useful to create a new shopping cart here)\n
"""\n """\n
from DateTime import DateTime\n from DateTime import DateTime\n
\n \n
...@@ -61,28 +69,44 @@ session_id = request.get(\'session_id\', None)\n ...@@ -61,28 +69,44 @@ session_id = request.get(\'session_id\', None)\n
portal_sessions = context.portal_sessions\n portal_sessions = context.portal_sessions\n
\n \n
if session_id is None:\n if session_id is None:\n
## first call so generate session_id and send back via cookie\n # first call so generate session_id and send back via cookie\n
now = DateTime()\n now = DateTime()\n
session_id = context.Base_generateSessionID(max_long=20)\n session_id = context.Base_generateSessionID(max_long=20)\n
request.RESPONSE.setCookie(\'session_id\', session_id, expires=(now +expire_timeout_days).fCommon(), path=\'/\')\n request.RESPONSE.setCookie(\'session_id\', session_id, expires=(now +expire_timeout_days).fCommon(), path=\'/\')\n
\n \n
if action==\'reset\':\n if action==\'reset\':\n
## reset cart \n # reset cart and return (a separate method would be better XXX)\n
portal_sessions.manage_delObjects(session_id)\n return portal_sessions.manage_delObjects(session_id)\n
else:\n \n
## take shopping cart for this customer\n # take shopping cart for this customer\n
shopping_cart_id = \'shopping_cart\'\n shopping_cart_id = \'shopping_cart\'\n
session = portal_sessions[session_id]\n session = portal_sessions[session_id]\n
if not shopping_cart_id in session.keys():\n
from Products.ERP5Type.Document import newTempOrder\n
web_site = context.getWebSiteValue()\n
shopping_cart = newTempOrder(portal_sessions, shopping_cart_id)\n
shopping_cart.setPriceCurrency(web_site.WebSite_getShoppingCartDefaultCurrency().getRelativeUrl())\n
session[shopping_cart_id] = shopping_cart\n
\n \n
## return just a part of session for shopping cart\n # some cleanup could be required if the shopping cart\n
# comes from a previous user with same session\n
if shopping_cart_id in session.keys():\n
shopping_cart = session[shopping_cart_id]\n shopping_cart = session[shopping_cart_id]\n
return shopping_cart\n if not shopping_cart.SaleOrder_isShoppingCartConsistent():\n
portal_sessions.manage_delObjects(session_id)\n
session = portal_sessions[session_id]\n
\n
# create shopping cart\n
if not shopping_cart_id in session.keys():\n
from Products.ERP5Type.Document import newTempOrder\n
web_site = context.getWebSiteValue()\n
shopping_cart = context.sale_order_module.newContent(portal_type="Sale Order", id=shopping_cart_id, temp_object=1, container=portal_sessions)\n
# Set usable security for Anonymous\n
shopping_cart.manage_role("Anonymous", ["Access contents information",\n
"Add portal content",\n
"Delete objects",\n
"Modify portal content",\n
"View"])\n
shopping_cart.setPriceCurrency(web_site.WebSite_getShoppingCartDefaultCurrency().getRelativeUrl())\n
session[shopping_cart_id] = shopping_cart\n
\n
## return just a part of session for shopping cart\n
shopping_cart = session[shopping_cart_id]\n
return shopping_cart\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -50,7 +50,15 @@ ...@@ -50,7 +50,15 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""Get the shopping cart customer"""\n <value> <string>"""\n
Get the shopping cart customer object.\n
\n
TODO:\n
- double check this method since the word "buyer"\n
has been used in other placed to name what is actually\n
the vendor, or has been used for other purpose.\n
- make sure this method really makes any sense\n
"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n shopping_cart = context.SaleOrder_getShoppingCart()\n
return shopping_cart.getDestinationDecisionValue()\n return shopping_cart.getDestinationDecisionValue()\n
</string> </value> </string> </value>
......
...@@ -50,7 +50,16 @@ ...@@ -50,7 +50,16 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""Get the shopping cart customer"""\n <value> <string>"""\n
Get the shopping cart customer as a Person object. \n
\n
TODO:\n
- add some consistency checks so that if current user\n
is not the current one defined in shopping\n
cart then reset shopping cart before proceeding. This\n
could happen if a wrong sequence of logout / add to cart\n
by two people sharing the same Web browser happens.\n
"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n shopping_cart = context.SaleOrder_getShoppingCart()\n
result = shopping_cart.getDestinationSectionValue()\n result = shopping_cart.getDestinationSectionValue()\n
if result is None:\n if result is None:\n
......
...@@ -50,7 +50,10 @@ ...@@ -50,7 +50,10 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>return context.REQUEST.get(\'session_id\')\n <value> <string>"""\n
Return shopping cart ID\n
"""\n
return context.REQUEST.get(\'session_id\')\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -63,7 +66,7 @@ ...@@ -63,7 +66,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Get shopping cart id</string> </value> <value> <string>Get shopping cart ID</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -51,10 +51,17 @@ ...@@ -51,10 +51,17 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>"""\n
Return list of shopping cart items.\n Return list of shopping cart items as list representing order lines.\n
XXX : get order_line as tree not just on first level\n \n
TODO:\n
- rename shopping_cart_order_lines to shopping_cart_order_line_list\n
- make this method compatible with cells and trees in orders. Orders\n
are not always flat. Consider large projects or matrices in B2B sales\n
of apparel. SaleOrder_getShoppingCartItemTree would be a better\n
name probably.\n
- make sure this script is not called more than once per page\n
"""\n """\n
shopping_cart_order_lines = context.SaleOrder_getShoppingCart().contentValues()\n shopping_cart_order_lines = context.SaleOrder_getShoppingCart().contentValues(portal_type="Sale Order Line")\n
if include_shipping:\n if include_shipping:\n
return shopping_cart_order_lines\n return shopping_cart_order_lines\n
else:\n else:\n
......
...@@ -61,7 +61,6 @@ ...@@ -61,7 +61,6 @@
\n \n
Script can optionally include currency.\n Script can optionally include currency.\n
"""\n """\n
\n
web_site = context.getWebSiteValue()\n web_site = context.getWebSiteValue()\n
total = 0.0\n total = 0.0\n
shopping_cart_item_list = context.SaleOrder_getShoppingCartItemList(include_shipping)\n shopping_cart_item_list = context.SaleOrder_getShoppingCartItemList(include_shipping)\n
......
...@@ -186,7 +186,15 @@ ...@@ -186,7 +186,15 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>if context.SaleOrder_isShippingRequired() and context.SaleOrder_getSelectedShippingResource() is None:\n <value> <string>"""\n
This method does a kind of ad-hoc consistency check\n
on the shopping cart based on the presence of a shipping method.\n
\n
TODO:\n
- use checkConsistency / fixConsistency framework of ERP5\n
(and extend it if needed with constraint categories)\n
"""\n
if context.SaleOrder_isShippingRequired() and context.SaleOrder_getSelectedShippingResource() is None:\n
## shipping is required but not selected\n ## shipping is required but not selected\n
return False\n return False\n
return True\n return True\n
......
...@@ -189,7 +189,11 @@ ...@@ -189,7 +189,11 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
\'\'\'\n \'\'\'\n
If all product have no Weight, it don\'t need to be sheep. \n If all product have no weight, then it does not need to be shipped.\n
\n
TODO:\n
- use ERP5 constrain framework checkConsistency/fixConsistency\n
in order to be perfectly generic\n
\'\'\'\n \'\'\'\n
return False\n return False\n
shopping_cart_items = context.SaleOrder_getShoppingCartItemList()\n shopping_cart_items = context.SaleOrder_getShoppingCartItemList()\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
In some cases, a session ID already exists in the browser\n
and can lead one user to access data created by another user.\n
Roles and permission will usually prevent this and raise\n
exception. This script tries to detect such situation in\n
order to make sure such data is deleted before this happens.\n
\n
TODO\n
- add log for "should never happen case" so that we can\n
make sure this case does not happen on public site\n
anymore\n
- rename script to SaleOrder_isShoppingCartUserConsistent\n
"""\n
result = True\n
\n
# If user is anonymous and destination is not None, inconsistent\n
isAnon = context.portal_membership.isAnonymousUser()\n
if isAnon and context.getDestinationSection():\n
return False\n
\n
# If the shopping cart customer is not the current user logged in, inconsistent\n
# This should never happen\n
if not isAnon:\n
destination_section = context.getDestinationSection()\n
customer = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
if destination_section and customer is not None:\n
if destination_section != customer.getRelativeUrl():\n
return False\n
\n
return result\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_isShoppingCartConsistent</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Detect shared shopping cart</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -50,7 +50,13 @@ ...@@ -50,7 +50,13 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>return len(context.SaleOrder_getShoppingCartItemList())==0\n <value> <string>"""\n
Returns true if the shopping cart is empty\n
\n
TODO:\n
- make sure this script is not called more than once per page\n
"""\n
return len(context.SaleOrder_getShoppingCartItemList())==0\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -50,23 +50,30 @@ ...@@ -50,23 +50,30 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># check if the user is Anonymous, if yes it must be redirected to Registration Dialog\n <value> <string>"""\n
Redirect to relevant payment mode and force if necessary user\n
to register first.\n
"""\n
# check if the user is Anonymous, if yes he/she must be redirected to Registration Dialog\n
# otherwise it will redirect to the appropriated payment form based on Payment Mode selected\n # otherwise it will redirect to the appropriated payment form based on Payment Mode selected\n
request = context.REQUEST\n request = context.REQUEST\n
isAnon = context.portal_membership.isAnonymousUser()\n isAnon = context.portal_membership.isAnonymousUser()\n
translateString = context.Base_translateString\n translateString = context.Base_translateString\n
\n \n
if field_my_comment is not None:\n shopping_cart = context.SaleOrder_getShoppingCart()\n
shopping_cart = context.SaleOrder_getShoppingCart()\n field_my_comment = shopping_cart.getComment()\n
shopping_cart.setComment(field_my_comment)\n field_my_payment_mode = shopping_cart.getPaymentConditionPaymentMode()\n
\n \n
if isAnon:\n if isAnon:\n
# create first an account for user\n # create first an account for user\n
web_site = context.getWebSiteValue()\n web_site = context.getWebSiteValue()\n
msg = translateString("You need to create an account to continue. If you already have please login.")\n msg = translateString("You need to create an account to continue. If you already have please login.")\n
web_site.Base_redirect(\'register\', \\\n from ZTUtils import make_query\n
keep_items={\'portal_status_message\': msg})\n parameter_string = make_query(field_my_comment=field_my_comment, field_my_payment_mode=field_my_payment_mode)\n
return\n coming_from_url = \'%s/SaleOrder_paymentRedirect?%s\' % (context.absolute_url(), parameter_string)\n
return web_site.Base_redirect(\'register\', \\\n
keep_items={\'portal_status_message\': msg,\n
\'coming_from_url\': coming_from_url})\n
\n \n
if field_my_payment_mode is None:\n if field_my_payment_mode is None:\n
msg = translateString("You must select a payment mode.")\n msg = translateString("You must select a payment mode.")\n
...@@ -85,7 +92,7 @@ context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n ...@@ -85,7 +92,7 @@ context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>field_my_comment=None, field_my_payment_mode=None, **kw</string> </value> <value> <string>**kw</string> </value>
</item> </item>
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
...@@ -99,6 +106,10 @@ context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n ...@@ -99,6 +106,10 @@ context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>SaleOrder_paymentRedirect</string> </value> <value> <string>SaleOrder_paymentRedirect</string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string>Redirect to registration or payment page</string> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
...@@ -50,7 +50,9 @@ ...@@ -50,7 +50,9 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""Set connected user as shopping cart customer"""\n <value> <string>"""\n
Set connected user as shopping cart customer\n
"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n shopping_cart = context.SaleOrder_getShoppingCart()\n
member = context.ERP5Site_getAuthenticatedMemberPersonValue()\n member = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
shopping_cart.edit(destination_section_value=member)\n shopping_cart.edit(destination_section_value=member)\n
......
...@@ -65,7 +65,7 @@ if parameter_dict[\'PAYERID\'] != payer_id:\n ...@@ -65,7 +65,7 @@ if parameter_dict[\'PAYERID\'] != payer_id:\n
\n \n
#redirect user to the checkout section\n #redirect user to the checkout section\n
website = context.getWebSiteValue() \n website = context.getWebSiteValue() \n
section_url = website.getLayoutProperty(\'ecommerce_checkout_section_id\',"checkout")\n section_url = website.getLayoutProperty(\'ecommerce_checkout_section_id\', \'checkout\')\n
website.Base_redirect(section_url, \\\n website.Base_redirect(section_url, \\\n
keep_items={\'portal_status_message\':translateString("The payment procedure went well on Paypal."),\n keep_items={\'portal_status_message\':translateString("The payment procedure went well on Paypal."),\n
\'token\':token})\n \'token\':token})\n
......
...@@ -50,7 +50,11 @@ ...@@ -50,7 +50,11 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>order_parameter_dict = context.WebSite_getPaypalOrderParameterDict()\n <value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
order_parameter_dict = context.WebSite_getPaypalOrderParameterDict()\n
if order_parameter_dict is None:\n if order_parameter_dict is None:\n
return None\n return None\n
order_parameter_dict[\'TOKEN\'] = token\n order_parameter_dict[\'TOKEN\'] = token\n
......
...@@ -50,7 +50,11 @@ ...@@ -50,7 +50,11 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>request = context.REQUEST\n <value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
request = context.REQUEST\n
isAnon = context.portal_membership.isAnonymousUser()\n isAnon = context.portal_membership.isAnonymousUser()\n
translateString = context.Base_translateString\n translateString = context.Base_translateString\n
\n \n
......
...@@ -50,7 +50,11 @@ ...@@ -50,7 +50,11 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>security_parameter_dict = context.WebSite_getPaypalSecurityParameterDict()\n <value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
security_parameter_dict = context.WebSite_getPaypalSecurityParameterDict()\n
if security_parameter_dict is None:\n if security_parameter_dict is None:\n
return None\n return None\n
security_parameter_dict[\'TOKEN\'] = token\n security_parameter_dict[\'TOKEN\'] = token\n
......
...@@ -50,7 +50,11 @@ ...@@ -50,7 +50,11 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>response_parameter_dict = context.WebSection_submitPaypalNVPRequest(parameter_dict=context.WebSite_getPaypalOrderParameterDict(),\n <value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
response_parameter_dict = context.WebSection_submitPaypalNVPRequest(parameter_dict=context.WebSite_getPaypalOrderParameterDict(),\n
nvp_url=context.WebSite_getPaypalUrl(api=\'nvp\', alternative_url=alternative_url))\n nvp_url=context.WebSite_getPaypalUrl(api=\'nvp\', alternative_url=alternative_url))\n
\n \n
if response_parameter_dict is None:\n if response_parameter_dict is None:\n
......
...@@ -50,7 +50,16 @@ ...@@ -50,7 +50,16 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>context.REQUEST.set(\'editable_mode\', 1)\n <value> <string>"""\n
Displays the current person information (ie. the one of the customer defined in the shopping cart).\n
\n
TODO:\n
- reimplement using Person_viewAsWeb and appropriate form_view_editable template\n
- it is probably not needed to use the shopping cart to know who is the customer\n
(unless we want one use to update information of another user)\n
- consider merging this with standard user preference settings of ERP5 web\n
"""\n
context.REQUEST.set(\'editable_mode\', 1)\n
person_object = context.getWebSiteValue().SaleOrder_getShoppingCartCustomer()\n person_object = context.getWebSiteValue().SaleOrder_getShoppingCartCustomer()\n
return context.getWebSectionValue().restrictedTraverse(person_object.getRelativeUrl()).Person_viewAsWeb(context.REQUEST)\n return context.getWebSectionValue().restrictedTraverse(person_object.getRelativeUrl()).Person_viewAsWeb(context.REQUEST)\n
</string> </value> </string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
"""\n
This script is a sample script skeleton (part of erp5_web)\n
which can be used to create user (Person object) \n
\n
Notes:\n
- the script is normally executed by anonymous user with Manager proxy roles which \n
you have to turn on after adjusting this script to your needs.\n
- you have to decide if assignment should be opened automatically or \n
verified and opened by administrator first\n
- you need to adjust group, function and site to your needs\n
\n
TODO:\n
- change hardcoding to site properties (ex. \'client\')\n
- implement auto-login in a generic way by inspecting\n
site properties (portal cookie authentication)\n
"""\n
from Products.Formulator.Errors import ValidationError, FormValidationError\n
portal = context.getPortalObject()\n
translateString = context.Base_translateString\n
website = context.getWebSiteValue()\n
\n
# Call Base_edit\n
result, result_type = context.Base_edit(form_id, silent_mode=1, field_prefix=\'your_\')\n
\n
# Return if not appropriate\n
if result_type != \'edit\':\n
return result\n
kw, encapsulated_editor_list = result\n
\n
# Set default values\n
person_group = None\n
person_function = None\n
person_site = None\n
person_role = \'client\'\n
kw.setdefault(\'reference\', kw[\'default_email_text\'])\n
if \'password_confirm\' in kw:\n
del kw[\'password_confirm\']\n
\n
#Check that user doesn\'t already exists\n
person_list = portal.acl_users.erp5_users.getUserByLogin(kw[\'reference\'])\n
if person_list:\n
msg = translateString("This account already exists. Please provide another email address.")\n
kw[\'portal_status_message\'] = msg\n
context.REQUEST.form.update(kw)\n
return getattr(website, form_id)()\n
\n
# create Person account\n
person_module = portal.getDefaultModule(portal_type=\'Person\')\n
person = person_module.newContent(portal_type=\'Person\', **kw)\n
person.manage_setLocalRoles(kw[\'reference\'], [\'Owner\'])\n
person.validate()\n
# do not immediate reindex object\n
# this means that when creating an account the new one will *NOT*\n
# be available immediately and we should consider sending two email to user\n
# that 1) his account will be created and when created 2)-> send account info\n
person.immediateReindexObject() # hack to make it possible to log\n
person.updateLocalRolesOnSecurityGroups() # Force setting security without interaction workflow (for now) XXX\n
\n
# Create default career\n
career = person.newContent(portal_type=\'Career\',\n
id=\'default_career\',\n
group=person_group,\n
function=person_function,\n
role=person_role)\n
# Create assignment\n
assignment = person.newContent(portal_type=\'Assignment\',\n
group=person_group,\n
function=person_function,\n
role=person_role, # Required for security based on role\n
site=person_site)\n
assignment.open()\n
\n
msg = translateString("Your account was successfully created.")\n
\n
# Set owner local role for cart if needed\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
shopping_cart.manage_setLocalRoles(kw[\'reference\'], [\'Owner\'])\n
\n
# Redirect if needed to coming_from_url\n
coming_from_url = kw[\'coming_from_url\']\n
if coming_from_url:\n
from ZTUtils import make_query\n
parameter_string = make_query(__ac_name=kw[\'reference\'], __ac_password=kw[\'password\'],\n
portal_status_message=msg, editable_mode=0)\n
return context.REQUEST.RESPONSE.redirect(\'%s?%s\' % (coming_from_url, parameter_string))\n
\n
return website.Base_redirect(form_id, keep_items=dict(portal_status_message=msg,\n
__ac_name=kw[\'reference\'], # XXX - Make it generic\n
__ac_password=kw[\'password\'], # XXX - Make it generic\n
editable_mode=0))\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>form_id</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSite_createWebSiteAccount</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Create Web Site User Account (MERGE THIS)</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -50,7 +50,11 @@ ...@@ -50,7 +50,11 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>order_parameter_dict = context.WebSite_getPaypalSecurityParameterDict()\n <value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
order_parameter_dict = context.WebSite_getPaypalSecurityParameterDict()\n
if order_parameter_dict is None:\n if order_parameter_dict is None:\n
return None\n return None\n
\n \n
......
...@@ -50,7 +50,11 @@ ...@@ -50,7 +50,11 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>if context.getLayoutProperty(\'ecommerce_test_environment_enabled\', False):\n <value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
if context.getLayoutProperty(\'ecommerce_test_environment_enabled\', False):\n
security_parameter_dict = {\'USER\':context.getLayoutProperty(\'ecommerce_paypal_sandbox_username\', None),\n security_parameter_dict = {\'USER\':context.getLayoutProperty(\'ecommerce_paypal_sandbox_username\', None),\n
\'PWD\':context.getLayoutProperty(\'ecommerce_paypal_sandbox_password\', None),\n \'PWD\':context.getLayoutProperty(\'ecommerce_paypal_sandbox_password\', None),\n
\'SIGNATURE\':context.getLayoutProperty(\'ecommerce_paypal_sandbox_signature\', None),\n \'SIGNATURE\':context.getLayoutProperty(\'ecommerce_paypal_sandbox_signature\', None),\n
......
...@@ -50,7 +50,11 @@ ...@@ -50,7 +50,11 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>if alternative_url is not None:\n <value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
if alternative_url is not None:\n
return alternative_url\n return alternative_url\n
\n \n
test_environement = context.getLayoutProperty(\'ecommerce_test_environment_enabled\', None)\n test_environement = context.getLayoutProperty(\'ecommerce_test_environment_enabled\', None)\n
......
...@@ -52,6 +52,12 @@ ...@@ -52,6 +52,12 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>""" \n <value> <string>""" \n
Return the current step for checkout procedure that will be displayed on Shopping Cart page.\n Return the current step for checkout procedure that will be displayed on Shopping Cart page.\n
\n
TODO:\n
- findout where this is used\n
- make sure that this script is either used everywhere\n
(and centralized sales workflow) or nowhere (local approach,\n
spaguettish but more consistent)\n
"""\n """\n
web_site = context.getWebSiteValue()\n web_site = context.getWebSiteValue()\n
shopping_cart = web_site.SaleOrder_getShoppingCart()\n shopping_cart = web_site.SaleOrder_getShoppingCart()\n
......
...@@ -52,9 +52,14 @@ ...@@ -52,9 +52,14 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>""" \n <value> <string>""" \n
Return default currency used in Shopping Cart.\n Return default currency used in Shopping Cart.\n
\n
TODO:\n
- remove hardcoding of currency_module/EUR \n
(ex. use system properties for example)\n
"""\n """\n
web_site = context.getWebSiteValue()\n web_site = context.getWebSiteValue()\n
return context.getPortalObject().restrictedTraverse(web_site.getLayoutProperty(\'ecommerce_base_currency\', \'currency_module/EUR\'))\n return context.getPortalObject().restrictedTraverse(\n
web_site.getLayoutProperty(\'ecommerce_base_currency\', \'currency_module/EUR\'))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -52,6 +52,9 @@ ...@@ -52,6 +52,9 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>""" \n <value> <string>""" \n
Return reference of the default currency used in Shopping Cart.\n Return reference of the default currency used in Shopping Cart.\n
\n
TODO:\n
- add pretty printing of currency (if it makes sense here)\n
"""\n """\n
website = context.getWebSiteValue()\n website = context.getWebSiteValue()\n
if website:\n if website:\n
......
...@@ -51,7 +51,11 @@ ...@@ -51,7 +51,11 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>""" \n <value> <string>""" \n
Return the sort title of the default currency used in Shopping Cart.\n Return the short title of the default currency used in Shopping Cart.\n
\n
TODO:\n
- the currency symbol and code are used inconsistently\n
take a decision of which to use where and stick to it\n
"""\n """\n
return context.getWebSiteValue().WebSite_getShoppingCartDefaultCurrency().getShortTitle()\n return context.getWebSiteValue().WebSite_getShoppingCartDefaultCurrency().getShortTitle()\n
</string> </value> </string> </value>
......
...@@ -50,28 +50,48 @@ ...@@ -50,28 +50,48 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>translateString = context.Base_translateString \n <value> <string encoding="cdata"><![CDATA[
"""\n
This script initializes an ecommerce web site by creating relevant\n
web sections.\n
\n
It is a destructive script. Make sure you never run it on an \n
existing site.\n
\n
TODO:\n
- add security definitions and workflows (or in bt5)\n
- product module security & commerce workflow\n
- service module security & commerce workflow\n
- currency module security & commerce workflow\n
- anonymous access to person module\n
- anonymous access to Sale Order Module\n
- anonymous access to sale_trade_condition_module\n
"""\n
translateString = context.Base_translateString \n
\n \n
if (context.getPortalType() != \'Web Site\'):\n if (context.getPortalType() != \'Web Site\'):\n
context.Base_redirect(\'\', keep_items={\n context.Base_redirect(\'\', keep_items={\n
\'portal_status_message\': translateString("You can only launch this script on a web site.", mapping = dict())\n \'portal_status_message\': translateString("You can only launch this script on a web site.", mapping = dict())\n
})\n })\n
\n \n
# creation the default sections\n # Create default sections (cart, account, register, checkout)\n
object_id_list = [\'cart\', \'account\', \'register\']\n # First delete whatever exists\n
object_id_list = [\'cart\', \'account\', \'register\', \'checkout\']\n
for id in object_id_list:\n for id in object_id_list:\n
if id in context.objectIds():\n if id in context.objectIds():\n
context.manage_delObjects([id])\n context.manage_delObjects([id])\n
\n \n
# Then recreate sections with default title\n
cart_section = context.newContent(portal_type=\'Web Section\', title=\'Cart\', id=\'cart\')\n cart_section = context.newContent(portal_type=\'Web Section\', title=\'Cart\', id=\'cart\')\n
account_section = context.newContent(portal_type=\'Web Section\', title=\'My account\', id=\'account\')\n account_section = context.newContent(portal_type=\'Web Section\', title=\'My account\', id=\'account\')\n
register_section = context.newContent(portal_type=\'Web Section\', title=\'Register\', id=\'register\')\n register_section = context.newContent(portal_type=\'Web Section\', title=\'Register\', id=\'register\')\n
checkout_section = context.newContent(portal_type=\'Web Section\', title=\'Checkout\', id=\'checkout\')\n checkout_section = context.newContent(portal_type=\'Web Section\', title=\'Checkout\', id=\'checkout\')\n
\n \n
# make some visible by default\n # Some sections should be visible by default\n
cart_section.setVisible(True)\n cart_section.setVisible(True)\n
\n \n
# setup site properties\n # Setup site properties to default values\n
context.setContainerLayout(\'erp5_web_multiflex5_commerce_layout\')\n context.setContainerLayout(\'erp5_web_multiflex5_commerce_layout\')\n
context.setLayoutConfigurationFormId(\'WebSection_viewMultiflex5Configuration\')\n context.setLayoutConfigurationFormId(\'WebSection_viewMultiflex5Configuration\')\n
context.setProperty(\'layout_right_column\', True)\n context.setProperty(\'layout_right_column\', True)\n
...@@ -79,16 +99,22 @@ context.setSiteMapSectionParent(True)\n ...@@ -79,16 +99,22 @@ context.setSiteMapSectionParent(True)\n
context.setContentLayout(None)\n context.setContentLayout(None)\n
context.setProperty(\'layout_additional_css\', \'mf54_commerce.css\')\n context.setProperty(\'layout_additional_css\', \'mf54_commerce.css\')\n
\n \n
# setup default render method\n # Setup default render method for cart section\n
cart_section.setCustomRenderMethodId(\'SaleOrder_viewAsWeb\')\n cart_section.setCustomRenderMethodId(\'SaleOrder_viewAsWeb\')\n
cart_section.setProperty(\'ecommerce_default_content\', True)\n cart_section.setProperty(\'ecommerce_default_content\', True)\n
cart_section.setProperty(\'ecommerce_product_list\', False)\n cart_section.setProperty(\'ecommerce_product_list\', False)\n
\n
# Setup default render method for account section\n
account_section.setCustomRenderMethodId(\'WebSection_viewCurrentPersonAsWeb\')\n account_section.setCustomRenderMethodId(\'WebSection_viewCurrentPersonAsWeb\')\n
account_section.setProperty(\'ecommerce_default_content\', True)\n account_section.setProperty(\'ecommerce_default_content\', True)\n
account_section.setProperty(\'ecommerce_product_list\', False)\n account_section.setProperty(\'ecommerce_product_list\', False)\n
\n
# Setup default render method for registration section\n
register_section.setCustomRenderMethodId(\'WebSite_viewRegistrationDialog\')\n register_section.setCustomRenderMethodId(\'WebSite_viewRegistrationDialog\')\n
register_section.setProperty(\'ecommerce_default_content\', True)\n register_section.setProperty(\'ecommerce_default_content\', True)\n
register_section.setProperty(\'ecommerce_product_list\', False)\n register_section.setProperty(\'ecommerce_product_list\', False)\n
\n
# Setup default render method for checkout section\n
checkout_section.setCustomRenderMethodId(\'SaleOrder_viewConfirmAsWeb\')\n checkout_section.setCustomRenderMethodId(\'SaleOrder_viewConfirmAsWeb\')\n
checkout_section.setProperty(\'ecommerce_default_content\', True)\n checkout_section.setProperty(\'ecommerce_default_content\', True)\n
checkout_section.setProperty(\'ecommerce_product_list\', False)\n checkout_section.setProperty(\'ecommerce_product_list\', False)\n
...@@ -96,7 +122,9 @@ checkout_section.setProperty(\'ecommerce_product_list\', False)\n ...@@ -96,7 +122,9 @@ checkout_section.setProperty(\'ecommerce_product_list\', False)\n
context.Base_redirect(\'\', keep_items={\n context.Base_redirect(\'\', keep_items={\n
\'portal_status_message\': translateString("Your web site is now an ecommerce plateform.", mapping = dict())\n \'portal_status_message\': translateString("Your web site is now an ecommerce plateform.", mapping = dict())\n
})\n })\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>WebSite_createPersonAccount</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Create a new account. Includes a hidden field whenever it is needed to proceed to a next step.</string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left (User Login)</string>
<string>right (User Identity)</string>
<string>center</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>center</string> </key>
<value>
<list>
<string>your_coming_from_url</string>
</list>
</value>
</item>
<item>
<key> <string>left (User Login)</string> </key>
<value>
<list>
<string>your_reference</string>
<string>your_password</string>
<string>your_password_confirm</string>
</list>
</value>
</item>
<item>
<key> <string>right (User Identity)</string> </key>
<value>
<list>
<string>your_first_name</string>
<string>your_last_name</string>
<string>your_default_email_text</string>
<string>your_default_telephone_text</string>
<string>your_default_fax_text</string>
<string>your_default_address_street_address</string>
<string>your_default_address_city</string>
<string>your_default_address_zip_code</string>
<string>your_default_address_region</string>
<string>submit</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSite_viewRegistrationDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>WebSite_createWebSiteAccountForm</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view_editable</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Create Your New Account (MERGE)</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>name</string>
<string>title</string>
<string>default</string>
<string>css_class</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>submit</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>css_class</string> </key>
<value> <string>hiddenLabel</string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string>Register New User</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_input_button_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>WebSite_createWebSiteAccount:action</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Register</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_address_city</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>City</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>items</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_address_region</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_list_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Country</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/portal_categories/region/getCategoryChildLogicalPathItemList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>whitespace_preserve</string>
<string>height</string>
<string>width</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_address_street_address</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_text_area_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Address</string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>30</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>display_width</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_address_zip_code</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>display_width</string> </key>
<value> <int>10</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Post Code</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>required</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_email_text</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_email</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_fax_text</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>FAX</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_telephone_text</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Telephone</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>title</string>
<string>css_class</string>
<string>required</string>
<string>display_width</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_first_name</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>css_class</string> </key>
<value> <string>visible_label</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>First name of the use wanting to register</string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>15</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>First Name</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>title</string>
<string>css_class</string>
<string>required</string>
<string>display_width</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_last_name</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>css_class</string> </key>
<value> <string>visible_label</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Last Name of the user wanting to register</string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>15</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Last Name</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>css_class</string>
<string>required</string>
<string>external_validator</string>
<string>display_width</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_password</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>css_class</string> </key>
<value> <string>visible_label</string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>12</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_password</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>WebSite_validatePasswordsMatch</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>css_class</string>
<string>required</string>
<string>external_validator</string>
<string>display_width</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_password_confirm</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>css_class</string> </key>
<value> <string>visible_label</string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>12</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_password</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Password (confirm)</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>WebSite_validatePasswordsMatch</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>description</string>
<string>display_width</string>
<string>external_validator</string>
<string>required</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_reference</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>The username this person will use to log in the system. The system will check that there isn\'t another user with the same username.</string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>12</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>User Login</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>WebSite_isValidUserReference</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -193,7 +193,6 @@ fieldset.editable div.input {padding:0px;}\n ...@@ -193,7 +193,6 @@ fieldset.editable div.input {padding:0px;}\n
.main_content table tr.thead_bottom td {border: solid 1px <tal:block tal:replace="primary_color"/>;border-width: 1px 0px 1px 0px;}\n .main_content table tr.thead_bottom td {border: solid 1px <tal:block tal:replace="primary_color"/>;border-width: 1px 0px 1px 0px;}\n
.main_content table tr.tfoot {border:none;}\n .main_content table tr.tfoot {border:none;}\n
.main_content table caption {margin-top:10px; text-align:center; padding-bottom:10px;}\n .main_content table caption {margin-top:10px; text-align:center; padding-bottom:10px;}\n
.main_content button.sort_button {float:left;}\n
.main_content th img {clear:none; border:none; margin-left:5px;}\n .main_content th img {clear:none; border:none; margin-left:5px;}\n
.main_content .pageNavigation input {vertical-align:middle;}\n .main_content .pageNavigation input {vertical-align:middle;}\n
.main_content table td.td_check_all {background-color:<tal:block tal:replace="body_color"/>;}\n .main_content table td.td_check_all {background-color:<tal:block tal:replace="body_color"/>;}\n
...@@ -204,9 +203,21 @@ fieldset.editable div.input {padding:0px;}\n ...@@ -204,9 +203,21 @@ fieldset.editable div.input {padding:0px;}\n
.main_content table tr.shopping_cart_end_lines td {border:none;}\n .main_content table tr.shopping_cart_end_lines td {border:none;}\n
.main_content table tr.shopping_cart_end_lines td.used {border-bottom:solid 1px #CCC;}\n .main_content table tr.shopping_cart_end_lines td.used {border-bottom:solid 1px #CCC;}\n
\n \n
\n .main_content button.sort_button,\n
</tal:block>\n table.listbox th button.sort-button {\n
text-decoration: underline;\n
padding: 0px;\n
border-width: 0;\n
cursor: pointer;\n
float: left;\n
background: transparent;\n
color: #505050;\n
font-size: 80% !important;\n
font-weight: bold;\n
height: 3em;\n
}\n
\n
</tal:block>
]]></unicode> </value> ]]></unicode> </value>
</item> </item>
...@@ -224,7 +235,7 @@ fieldset.editable div.input {padding:0px;}\n ...@@ -224,7 +235,7 @@ fieldset.editable div.input {padding:0px;}\n
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value> <value> <string>iso-8859-15</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Find default image for a given resource. If no image\n
is defined on the resource itself, look in each individual\n
variation.\n
\n
TODO:\n
- make the variation support generic (remove hardcoded "variation"\n
and use another approach to select default variation based\n
for example on a default variation order or int_index)\n
- make this script cached per transaction\n
"""\n
request = context.REQUEST\n
variation = request.get(\'variation\', None)\n
if variation:\n
variation = context.getWebSiteValue().restrictedTraverse(variation)\n
image = variation.getDefaultImageValue()\n
if image is not None:\n
return image.absolute_url()\n
\n
default_image = context.getDefaultImageValue()\n
if default_image is not None:\n
return default_image.absolute_url()\n
\n
if \'variation\' in context.getVariationBaseCategoryList():\n
default_variation = context.getVariationRangeCategoryList(base_category_list=[\'variation\'])\n
if len(default_variation):\n
default_variation = default_variation[0]\n
default_variation = default_variation[len(\'variation/\'):]\n
default_image = context.getPortalObject().restrictedTraverse(default_variation).getDefaultImageValue()\n
if default_image is not None:\n
return default_image.absolute_url()\n
\n
return None\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Resource_getWebShopImageURL</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Return a URL for current product image</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -41,6 +41,12 @@ ...@@ -41,6 +41,12 @@
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>encoding</string> </key> <key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value> <value> <string>UTF-8</string> </value>
...@@ -86,6 +92,7 @@ ...@@ -86,6 +92,7 @@
<string>default_image</string> <string>default_image</string>
<string>my_default_image_absolute_url</string> <string>my_default_image_absolute_url</string>
<string>my_title</string> <string>my_title</string>
<string>variation_box</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -138,6 +145,10 @@ ...@@ -138,6 +145,10 @@
<key> <string>update_action</string> </key> <key> <string>update_action</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
...@@ -298,16 +298,13 @@ ...@@ -298,16 +298,13 @@
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.getDefaultImageValue() in (None, \'\') or here.getDefaultImageValue().getData() in (None, \'\')</string> </value> <value> <string>python: not here.Resource_getWebShopImageURL()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<string>default</string> <string>default</string>
<string>description</string> <string>description</string>
<string>enabled</string> <string>enabled</string>
<string>image_display</string>
<string>title</string> <string>title</string>
</list> </list>
</value> </value>
...@@ -62,7 +63,9 @@ ...@@ -62,7 +63,9 @@
</item> </item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -71,7 +74,7 @@ ...@@ -71,7 +74,7 @@
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -82,6 +85,10 @@ ...@@ -82,6 +85,10 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>image_display</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -121,6 +128,10 @@ ...@@ -121,6 +128,10 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>File_viewFieldLibrary</string> </value> <value> <string>File_viewFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>image_display</string> </key>
<value> <string>small</string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
...@@ -137,16 +148,26 @@ ...@@ -137,16 +148,26 @@
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
<global name="TALESMethod" module="Products.Formulator.TALESField"/> </pickle>
<tuple/> <pickle>
</tuple> <dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.Resource_getWebShopImageURL()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.getDefaultImageValue() not in (None, \'\') and here.getDefaultImageValue().getData() not in (None, \'\')</string> </value> <value> <string>python: here.Resource_getWebShopImageURL()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -261,10 +261,7 @@ ...@@ -261,10 +261,7 @@
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
......
...@@ -172,10 +172,7 @@ ...@@ -172,10 +172,7 @@
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="FormBox" module="Products.ERP5Form.FormBox"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>variation_box</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>form_invalidated</string> </key>
<value> <string>Form invalidated.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>formbox_target_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>formbox_target_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>formbox_target_id</string> </key>
<value> <string>Resource_viewVariationBox</string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Variation</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>nocall: here/Resource_viewVariationBox | nothing</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -265,10 +265,7 @@ ...@@ -265,10 +265,7 @@
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -281,10 +278,7 @@ ...@@ -281,10 +278,7 @@
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<tuple> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
......
...@@ -50,7 +50,14 @@ ...@@ -50,7 +50,14 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>web_site = context.getWebSiteValue()\n <value> <string>"""\n
TODO:\n
- it should be possible to have more than one root\n
product lines. In such case, using a predicate would\n
be way easier.... simply by checking if the root\n
predicate(s) apply\n
"""\n
web_site = context.getWebSiteValue()\n
resource = context.getResourceValue()\n resource = context.getResourceValue()\n
web_site_product_line = web_site.getLayoutProperty(\'ecommerce_base_product_line\')\n web_site_product_line = web_site.getLayoutProperty(\'ecommerce_base_product_line\')\n
portal_categories = context.getPortalObject().portal_categories\n portal_categories = context.getPortalObject().portal_categories\n
......
...@@ -76,7 +76,9 @@ ...@@ -76,7 +76,9 @@
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <value>
<list/> <list>
<string>listbox_variation_title</string>
</list>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -355,6 +355,14 @@ ...@@ -355,6 +355,14 @@
<string>title</string> <string>title</string>
<string>Title</string> <string>Title</string>
</tuple> </tuple>
<tuple>
<string>variation_title</string>
<string>Variation</string>
</tuple>
<tuple>
<string>getSizeTitle</string>
<string>Size</string>
</tuple>
<tuple> <tuple>
<string>getTotalQuantity</string> <string>getTotalQuantity</string>
<string>Quantity</string> <string>Quantity</string>
...@@ -378,6 +386,10 @@ ...@@ -378,6 +386,10 @@
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>default_display_style</string> </key>
<value> <string>table</string> </value>
</item>
<item> <item>
<key> <string>default_params</string> </key> <key> <string>default_params</string> </key>
<value> <value>
...@@ -388,6 +400,12 @@ ...@@ -388,6 +400,12 @@
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>display_style_list</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>domain_root_list</string> </key> <key> <string>domain_root_list</string> </key>
<value> <value>
...@@ -405,7 +423,12 @@ ...@@ -405,7 +423,12 @@
<item> <item>
<key> <string>editable_columns</string> </key> <key> <string>editable_columns</string> </key>
<value> <value>
<list/> <list>
<tuple>
<string>variation_title</string>
<string>variation_title</string>
</tuple>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -422,6 +445,10 @@ ...@@ -422,6 +445,10 @@
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>global_search_column</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
...@@ -450,6 +477,10 @@ ...@@ -450,6 +477,10 @@
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>page_navigation_template</string> </key>
<value> <string>ListBox_viewSliderPageNavigationRenderer</string> </value>
</item>
<item> <item>
<key> <string>page_template</string> </key> <key> <string>page_template</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -519,6 +550,12 @@ ...@@ -519,6 +550,12 @@
<key> <string>stat_method</string> </key> <key> <string>stat_method</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>style_columns</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Sale Order Lines</string> </value> <value> <string>Sale Order Lines</string> </value>
...@@ -537,6 +574,14 @@ ...@@ -537,6 +574,14 @@
<string>title</string> <string>title</string>
<string>SaleOrder_getResourceUrl</string> <string>SaleOrder_getResourceUrl</string>
</tuple> </tuple>
<tuple>
<string>variation_title</string>
<string>Variation</string>
</tuple>
<tuple>
<string>getSizeTitle</string>
<string>Size</string>
</tuple>
<tuple> <tuple>
<string>getTotalQuantity</string> <string>getTotalQuantity</string>
<string>SaleOrder_getResourceUrl</string> <string>SaleOrder_getResourceUrl</string>
...@@ -556,10 +601,7 @@ ...@@ -556,10 +601,7 @@
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <global name="Method" module="Products.Formulator.MethodField"/>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
......
...@@ -65,13 +65,19 @@ ...@@ -65,13 +65,19 @@
<tal:block tal:repeat="order_line shopping_cart_item_list">\n <tal:block tal:repeat="order_line shopping_cart_item_list">\n
<tr tal:define="resource python: here.restrictedTraverse(order_line.getResource());\n <tr tal:define="resource python: here.restrictedTraverse(order_line.getResource());\n
quantity python: int(order_line.getQuantity());\n quantity python: int(order_line.getQuantity());\n
price python: resource.getPrice();\n price python: order_line.getPrice();\n
order_line_id python: order_line.getId();">\n order_line_id python: order_line.getId();">\n
<td>\n <td>\n
<div tal:attributes="class string: shopping_cart_renderer_title">\n <div tal:attributes="class string: shopping_cart_renderer_title"\n
<a href="" tal:attributes="href python: \'%s/%s\' % (resource.absolute_url(), \'Resource_viewAsShop\');">\n tal:define="variation order_line/getVariation | string:;\n
<span tal:replace="resource/getTitle"/> \n variation_title order_line/getVariationTitle | nothing;\n
size_title order_line/getSizeTitle | nothing">\n
<a href="" tal:attributes="href python: \'%s/%s?variation=%s\' %\n
(resource.absolute_url(), \'Resource_viewAsShop\', variation);">\n
<span tal:replace="resource/getTitle"/>\n
</a>\n </a>\n
<span tal:replace="variation_title" tal:condition="variation_title"/>\n
<span tal:replace="size_title" tal:condition="size_title"/>\n
</div>\n </div>\n
<div class="shopping_cart_renderer_remove">\n <div class="shopping_cart_renderer_remove">\n
<a tal:attributes="href python: \'%s/SaleOrder_deleteShoppingCartItem?field_my_order_line_id=%s\' \n <a tal:attributes="href python: \'%s/SaleOrder_deleteShoppingCartItem?field_my_order_line_id=%s\' \n
...@@ -92,7 +98,7 @@ ...@@ -92,7 +98,7 @@
<span tal:replace="price"/> <span tal:replace="currency_code"/>\n <span tal:replace="price"/> <span tal:replace="currency_code"/>\n
</td>\n </td>\n
<td>\n <td>\n
<span tal:replace="python: price*quantity"/> <span tal:replace="currency_code"/>\n <span tal:replace="python: (price or 0)*(quantity or 0)"/> <span tal:replace="currency_code"/>\n
</td>\n </td>\n
</tr>\n </tr>\n
</tal:block>\n </tal:block>\n
...@@ -172,8 +178,7 @@ ...@@ -172,8 +178,7 @@
</tal:block>\n </tal:block>\n
</div>\n </div>\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>
]]></unicode> </value> ]]></unicode> </value>
</item> </item>
......
...@@ -47,20 +47,26 @@ ...@@ -47,20 +47,26 @@
<tr tal:repeat="order_line shopping_cart_item_list">\n <tr tal:repeat="order_line shopping_cart_item_list">\n
<td tal:define="resource python: web_site.restrictedTraverse(order_line.getResource());\n <td tal:define="resource python: web_site.restrictedTraverse(order_line.getResource());\n
quantity python: int(order_line.getQuantity());\n quantity python: int(order_line.getQuantity());\n
price resource/getPrice;\n price order_line/getPrice;\n
currency web_site/WebSite_getShoppingCartDefaultCurrency;\n currency web_site/WebSite_getShoppingCartDefaultCurrency;\n
currency_symbol python: context.getPortalObject().restrictedTraverse(shopping_cart.getPriceCurrency()).getShortTitle();"\n currency_symbol python: context.getPortalObject().restrictedTraverse(shopping_cart.getPriceCurrency()).getShortTitle();\n
variation order_line/getVariation | string:;\n
variation_title order_line/getVariationTitle | nothing;\n
size_title order_line/getSizeTitle | nothing;"\n
class="cart_top"> \n class="cart_top"> \n
\n \n
<div class="cart_left cart_item_name">\n <div class="cart_left cart_item_name">\n
<span><span tal:replace="quantity"/> x </span>\n <span><span tal:replace="quantity"/> x </span>\n
<a class="articlelink" href="" tal:attributes="href python: \'%s/%s\' % (resource.absolute_url(), \'Resource_viewAsShop\');">\n <a class="articlelink" href="" tal:attributes="href python: \'%s/%s?variation=%s\' % (resource.absolute_url(), \'Resource_viewAsShop\', variation);">\n
<span tal:content="resource/getTitle"/>\n <span tal:content="resource/getTitle"/>\n
</a>\n </a>\n
<br tal:condition="variation_title | size_title"/>\n
<span tal:replace="variation_title" tal:condition="variation_title"/>\n
<span tal:replace="size_title" tal:condition="size_title"/>\n
</div>\n </div>\n
<div class="cart_right">\n <div class="cart_right">\n
<span>\n <span>\n
<span tal:replace="python: price * quantity"/> <span tal:replace="currency_symbol"/>\n <span tal:replace="python: (price or 0)*(quantity or 0)"/> <span tal:replace="currency_symbol"/>\n
</span>\n </span>\n
</div> \n </div> \n
</td>\n </td>\n
...@@ -88,15 +94,14 @@ ...@@ -88,15 +94,14 @@
<div class="cart_left">\n <div class="cart_left">\n
<a class="articlelink" \n <a class="articlelink" \n
tal:attributes="href python: \'%s/%s\' % (web_site.absolute_url(), web_site.getLayoutProperty(\'ecommerce_cart_section_id\', \'\'))">\n tal:attributes="href python: \'%s/%s\' % (web_site.absolute_url(), web_site.getLayoutProperty(\'ecommerce_cart_section_id\', \'\'))">\n
<span tal:replace="python: here.Base_translateString(\'Shopping Cart\')"/>\n <span tal:replace="python: here.Base_translateString(\'Edit / Checkout\')"/>\n
</a>\n </a>\n
</div>\n </div>\n
</td>\n </td>\n
</tr>\n </tr>\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
</table>\n </table>
]]></unicode> </value> ]]></unicode> </value>
</item> </item>
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key> <key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value> <value> <string>workflow</string> </value>
</item> </item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>actbox_name</string> </key> <key> <string>actbox_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -57,10 +61,7 @@ ...@@ -57,10 +61,7 @@
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <global name="Guard" module="Products.DCWorkflow.Guard"/>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -70,6 +71,7 @@ ...@@ -70,6 +71,7 @@
<tuple> <tuple>
<string>Assignee</string> <string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Manager</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key> <key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value> <value> <string>workflow</string> </value>
</item> </item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>actbox_name</string> </key> <key> <string>actbox_name</string> </key>
<value> <string>Invalidate</string> </value> <value> <string>Invalidate</string> </value>
...@@ -57,10 +61,7 @@ ...@@ -57,10 +61,7 @@
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <global name="Guard" module="Products.DCWorkflow.Guard"/>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -70,6 +71,7 @@ ...@@ -70,6 +71,7 @@
<tuple> <tuple>
<string>Assignor</string> <string>Assignor</string>
<string>Assignee</string> <string>Assignee</string>
<string>Manager</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
<tuple> <tuple>
<string>Assignor</string> <string>Assignor</string>
<string>Assignee</string> <string>Assignee</string>
<string>Manager</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key> <key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value> <value> <string>workflow</string> </value>
</item> </item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>actbox_name</string> </key> <key> <string>actbox_name</string> </key>
<value> <string>Validate</string> </value> <value> <string>Validate</string> </value>
...@@ -57,10 +61,7 @@ ...@@ -57,10 +61,7 @@
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <global name="Guard" module="Products.DCWorkflow.Guard"/>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -70,6 +71,7 @@ ...@@ -70,6 +71,7 @@
<tuple> <tuple>
<string>Assignor</string> <string>Assignor</string>
<string>Assignee</string> <string>Assignee</string>
<string>Manager</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
2012-08-27 jps
Full review of the business template with addition of TODOs to each script.
2010-09-30 nicolas.dumazet 2010-09-30 nicolas.dumazet
* Revert changes from 29th after adding Order abstract portal type to erp5_trade * Revert changes from 29th after adding Order abstract portal type to erp5_trade
......
To get the Anonymous navigation working is required to set some security: To get the Anonymous navigation working, it is necessary to set some security:
currency_module - Access contents information currency_module - Access contents information
product_module - Access contents information product_module - Access contents information
sale_order_module - Access contents information sale_order_module - Access contents information
\ No newline at end of file sale_trade_condition_module - Access contents information
TODO:
- merge account registration / creation into generic ERP5
284 287
\ No newline at end of file \ No newline at end of file
Sale Order Module | web_view
Sale Order | web_view
Web Section | ecommerce_configuration Web Section | ecommerce_configuration
Web Site | ecommerce_configuration Web Site | ecommerce_configuration
\ No newline at end of file
Currency | -validation_workflow Currency | -validation_workflow
Currency | commerce_validation_workflow Currency | commerce_validation_workflow
Product | -validation_workflow Product | -validation_workflow
Product | commerce_validation_workflow Product | commerce_validation_workflow
\ No newline at end of file Sale Trade Condition | -validation_workflow
Sale Trade Condition | commerce_validation_workflow
Service | -validation_workflow
Service | commerce_validation_workflow
\ 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