Commit 8e6f34ac authored by Rafael Monnerat's avatar Rafael Monnerat Committed by Xiaowu Zhang

erp5_commerce_related

parent 26c86d33
<?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}/Person_viewAsWeb</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()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -75,7 +75,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SaleOrder_viewDetailAsWeb</string> </value>
<value> <string>string:${object_url}/SaleOrder_viewAsWeb</string> </value>
</item>
</dictionary>
</pickle>
......@@ -88,7 +88,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: object is not None and object.isWebMode() and not object.isEditableMode()</string> </value>
<value> <string>python: object is not None and object.isWebMode()</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -57,6 +57,8 @@
TODO:\n
- handle form validation errors after the call to\n
Base_edit (not the case currently)\n
- handle security in a better way that proxy (if possible) \n
for password change for example\n
\n
BUG:\n
- make sure personal address can be updated from\n
......@@ -64,16 +66,33 @@
"""\n
translateString = context.Base_translateString \n
\n
context.Base_edit(form_id=\'Person_viewAsWeb\')\n
# Call Base_edit\n
result, result_type = context.Base_edit(\'Person_viewAsWeb\', silent_mode=1, field_prefix=\'my_\')\n
\n
context.ERP5Site_redirect(\'%s/account\' % context.getWebSiteValue().absolute_url(), \\\n
keep_items={\'portal_status_message\': translateString("Your personal informations are now updated.", mapping = dict())})\n
# Return if not appropriate\n
if result_type != \'edit\':\n
return result # XXX add support for editable in this call\n
\n
# Update data\n
kw, encapsulated_editor_list = result\n
context.edit(**kw)\n
\n
return context.Base_redirect(context.REQUEST.get("form_id", ""), \\\n
keep_items={\'portal_status_message\': translateString("Your personal informations are now updated.")})\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kw</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>Person_editPersonalInformation</string> </value>
......
......@@ -71,11 +71,12 @@
- rename to use asHTML terminology\n
"""\n
portal = context.getPortalObject()\n
category_path = \'portal_categories/publication_section/website/product/short_description\'\n
\n
# Find a related web page with appropriate publication_section\n
web_page = portal.portal_catalog(portal_type=\'Web Page\',\n
default_follow_up_uid=context.getUid(),\n
default_publication_section_uid=context.restrictedTraverse(\'portal_categories/publication_section/website/product/short_description\').getUid(), # XXX Bad hardcoding\n
default_publication_section_uid=context.restrictedTraverse(category_path).getUid(), # XXX Bad hardcoding\n
)\n
if web_page is None or len(web_page) == 0:\n
return context.Base_translateString("No more information for this product.")\n
......
......@@ -57,6 +57,7 @@
TODO:\n
- add support to input parameters (**kw) so that it\n
is possible specialize price calculation\n
- support alt default currency\n
"""\n
from Products.ERP5Type.Document import newTempMovement\n
\n
......@@ -64,8 +65,6 @@ from Products.ERP5Type.Document import newTempMovement\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
......@@ -84,8 +83,12 @@ if len(context.getVariationRangeCategoryList()):\n
variation_category = request.get(variation_base_category, default_variation)\n
variation_dict[variation_base_category] = variation_category\n
\n
if web_site_value is not None:\n
price_currency_value = web_site_value.WebSite_getShoppingCartDefaultCurrency()\n
else:\n
price_currency_value = context.getPortalObject().currency_module.EUR # hack\n
movement = newTempMovement(context, "temp_pricing_movement", resource_value=context,\n
price_currency_value=web_site_value.WebSite_getShoppingCartDefaultCurrency(),\n
price_currency_value=price_currency_value,\n
**variation_dict)\n
return movement\n
</string> </value>
......
......@@ -191,7 +191,6 @@
\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
shopping_cart = context.SaleOrder_getShoppingCart()\n
......@@ -202,7 +201,7 @@ if field_my_order_line_id is not None:\n
else:\n
portal_status_message = "Please select an item."\n
\n
context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
context.Base_redirect(context.REQUEST.get(\'form_id\', \'WebSection_viewShoppingCart\'), \\\n
keep_items={\'portal_status_message\': translateString(portal_status_message, mapping = dict())})\n
</string> </value>
</item>
......
......@@ -199,15 +199,25 @@
"""\n
request = context.REQUEST\n
translateString = context.Base_translateString \n
if field_my_buy_quantity is None:\n
field_my_buy_quantity=context.REQUEST.get("field_my_buy_quantity", None)\n
\n
if field_my_shipping_method is None:\n
field_my_shipping_method=context.REQUEST.get("field_my_shipping_method", None) \n
\n
if field_my_payment_mode is None:\n
field_my_payment_mode = context.REQUEST.get("field_my_payment_mode", None) \n
\n
quantity = field_my_buy_quantity\n
shipping_method = field_my_shipping_method\n
shopping_cart_items = context.SaleOrder_getShoppingCartItemList(include_shipping=True)\n
shopping_cart_products_items = filter(lambda x: x.getId()!=\'shipping_method\', shopping_cart_items)\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
\n
\n
# Handle change in quantity for shopping items\n
if quantity is not None:\n
# Whenever there is onlu one item in shoppping cart, quantity\n
# Whenever there is only one item in shoppping cart, quantity\n
# is a string rather as a list\n
if isinstance(quantity, str):\n
quantity = [quantity]\n
......@@ -226,28 +236,32 @@ if quantity is not None:\n
order_line = getattr(shopping_cart, \'shipping_method\', None)\n
if shipping_method not in [\'\', None]:\n
shipping = context.getPortalObject().restrictedTraverse(shipping_method)\n
if order_line is None:\n
if order_line is not None:\n
shopping_cart.manage_delObjects(order_line.getId())\n
# create new shipping method order line\n
order_line = shopping_cart.newContent(id=\'shipping_method\', portal_type=\'Sale Order Line\')\n
# .. and update it\n
order_line.setResource(shipping.getRelativeUrl())\n
order_line.setQuantity(1)\n
else:\n
if field_my_shipping_method in [\'\', None] and order_line is not None:\n
shopping_cart.manage_delObjects(order_line.getId())\n
\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
if field_my_comment is not None:\n
shopping_cart.setComment(field_my_comment)\n
\n
if field_my_payment_mode is not None:\n
shopping_cart.setPaymentConditionPaymentMode(field_my_payment_mode) # XXX This is bad because it does not use trade conditions XXX\n
\n
if redirect:\n
# Hardcode redirection.\n
return context.Base_redirect("WebSection_viewShoppingCart", \\\n
keep_items={\'portal_status_message\': translateString("Shopping Cart Updated.")})\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>field_my_buy_quantity=None, field_my_shipping_method=None, field_my_comment=None, field_my_payment_mode=None, **kw</string> </value>
<value> <string>field_my_buy_quantity=None, field_my_shipping_method=None, field_my_comment=None, field_my_payment_mode=None, redirect=True, **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</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>_Change_Python_Scripts_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Change_bindings_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Change_cache_settings_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Change_permissions_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Change_proxy_roles_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Manage_WebDAV_Locks_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Manage_properties_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Take_ownership_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_Undo_changes_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_View_History_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_View_management_screens_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_WebDAV_Lock_items_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_WebDAV_Unlock_items_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</value>
</item>
<item>
<key> <string>_WebDAV_access_Permission</string> </key>
<value>
<list>
<string>Manager</string>
</list>
</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
This script is called by external payment system.\n
It is possible to check here whether payment was successfull or not.\n
"""\n
\n
# XXX: implement external payment check\n
\n
# XXX: finalize order\n
\n
# XXX: redirect\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_externalPaymentHandler</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>External online payment system handler</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -192,9 +192,9 @@
\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
- do we really need Proxy manager ?\n
"""\n
from DateTime import DateTime\n
request = context.REQUEST\n
......@@ -203,8 +203,8 @@ isAnon = context.portal_membership.isAnonymousUser()\n
translateString = context.Base_translateString\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
shopping_cart_item_list = shopping_cart.SaleOrder_getShoppingCartItemList(include_shipping=True)\n
customer = shopping_cart.SaleOrder_getShoppingCartCustomer()\n
buyer = shopping_cart.SaleOrder_getShoppingCartBuyer()\n
customer = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
\n
\n
if isAnon:\n
# Create first an account for user\n
......@@ -213,19 +213,12 @@ if isAnon:\n
keep_items={\'portal_status_message\': msg})\n
return\n
\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 False:\n
raise ValueError, "Impossible to finalize an order which was not payed before"\n
\n
portal_type = shopping_cart.getPortalType()\n
module = context.getDefaultModule(portal_type)\n
sale_order = module.newContent(portal_type=portal_type,\n
destination_value = customer,\n
destination_section_value = customer,\n
destination_decision_value = customer,\n
source_section_value = buyer,\n
source_value = buyer,\n
start_date = DateTime(),\n
received_date = DateTime(),\n
comment = shopping_cart.getComment(),\n
......@@ -251,7 +244,7 @@ for order_line in shopping_cart_item_list:\n
sale_order.activate().order()\n
\n
# clean up shopping cart\n
context.SaleOrder_getShoppingCart(action=\'reset\')\n
context.WebSection_resetShoppingCart()\n
\n
# Display nice message\n
context.Base_redirect(\'SaleOrder_viewThankYouMessage\')\n
......@@ -261,6 +254,14 @@ context.Base_redirect(\'SaleOrder_viewThankYouMessage\')\n
<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_finalizeShopping</string> </value>
......
......@@ -198,9 +198,9 @@ portal = context.getPortalObject()\n
# XXX hardcoded category\n
shipping_product_line_category_uid = portal.portal_categories.product_line.shipping.getUid()\n
\n
return [r.getObject() for r in portal.portal_catalog(\n
product_line_uid=shipping_product_line_category_uid,\n
portal_type=portal.getPortalResourceTypeList())]\n
return portal.portal_catalog(product_line_uid=shipping_product_line_category_uid,\n
portal_type=portal.getPortalResourceTypeList(), \n
validation_state="published")\n
</string> </value>
</item>
<item>
......
......@@ -52,6 +52,10 @@
<key> <string>_body</string> </key>
<value> <string>"""\n
Return the default trade condition for thie ecommerce site\n
\n
TODO:\n
- (rafael) This script should be removed or turned into a preference at least.\n
\n
"""\n
default = "sale_trade_condition_module/default_trade_condition"\n
\n
......@@ -72,7 +76,7 @@ return context.getPortalObject().restrictedTraverse(default)\n
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Return default trade condition</string> </value>
<value> <string>DEPRECATED</string> </value>
</item>
</dictionary>
</pickle>
......
<?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
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
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_getFormattedCreationDate</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Format creation date</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -58,8 +58,9 @@
- 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
if price_currency_title == "Euro": \n
price_currency_title = "€"\n
return \'%0.2f %s\' % (context.getTotalPrice(), price_currency_title)\n
</string> </value>
</item>
<item>
......
......@@ -193,8 +193,8 @@ shopping_cart = context.SaleOrder_getShoppingCart()\n
shipping_method = getattr(shopping_cart, \'shipping_method\', None)\n
if shipping_method is not None:\n
return shipping_method.getResourceValue()\n
else:\n
return None\n
\n
return None\n
</string> </value>
</item>
<item>
......
......@@ -65,7 +65,7 @@ from DateTime import DateTime\n
\n
request = context.REQUEST\n
expire_timeout_days = 90\n
session_id = request.get(\'session_id\', None)\n
if session_id is None: session_id = request.get(\'session_id\', None)\n
portal_sessions = context.portal_sessions\n
\n
if session_id is None:\n
......@@ -86,21 +86,25 @@ session = portal_sessions[session_id]\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
if not shopping_cart.SaleOrder_isShoppingCartConsistent():\n
portal_sessions.manage_delObjects(session_id)\n
session = portal_sessions[session_id]\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
shopping_cart = context.sale_order_module.newContent(portal_type="Sale Order", \n
id=shopping_cart_id, \n
temp_object=1, \n
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.setSpecialise(web_site.WebSection_getDefaultTradeCondition())\n
shopping_cart.setPriceCurrency(web_site.WebSite_getShoppingCartDefaultCurrency().getRelativeUrl())\n
session[shopping_cart_id] = shopping_cart\n
\n
......@@ -111,7 +115,7 @@ return shopping_cart\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>action=\'\', new_shopping_cart=None</string> </value>
<value> <string>action=\'\', new_shopping_cart=None, session_id=None</string> </value>
</item>
<item>
<key> <string>_proxy_roles</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
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
return shopping_cart.getDestinationDecisionValue()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_getShoppingCartBuyer</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get shopping cart customer object</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -78,7 +78,7 @@ if include_taxes:\n
\n
if include_currency:\n
currency = web_site.WebSite_getShoppingCartDefaultCurrency()\n
return \'%s %s\' %(total, currency.getReference())\n
return \'%s %s\' % (total, currency.getReference())\n
else:\n
return str(total)\n
</string> </value>
......
......@@ -195,15 +195,15 @@
- use ERP5 constrain framework checkConsistency/fixConsistency\n
in order to be perfectly generic\n
\'\'\'\n
return False\n
#return False\n
shopping_cart_items = context.SaleOrder_getShoppingCartItemList()\n
\n
weight = 0\n
for order_line in shopping_cart_items:\n
resource = order_line.getResourceValue()\n
weight += resource.getBaseWeight(0)\n
if resource.getBaseWeight(0) > 0:\n
return True\n
\n
return weight > 0\n
return False\n
]]></string> </value>
......
......@@ -61,7 +61,6 @@
- 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
......
......@@ -56,6 +56,8 @@
TODO:\n
- make sure this script is not called more than once per page\n
"""\n
if context.REQUEST.get(\'session_id\', None) is None:\n
return True\n
return len(context.SaleOrder_getShoppingCartItemList())==0\n
</string> </value>
</item>
......
......@@ -60,6 +60,9 @@ request = context.REQUEST\n
isAnon = context.portal_membership.isAnonymousUser()\n
translateString = context.Base_translateString\n
\n
# Make sure we save shopping cart informations modified on last minute.\n
context.SaleOrder_editShoppingCart(redirect=False, **kw)\n
\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
field_my_comment = shopping_cart.getComment()\n
field_my_payment_mode = shopping_cart.getPaymentConditionPaymentMode()\n
......@@ -67,26 +70,26 @@ field_my_payment_mode = shopping_cart.getPaymentConditionPaymentMode()\n
if isAnon:\n
# create first an account for user\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 login or create an account to continue.")\n
from ZTUtils import make_query\n
parameter_string = make_query(field_my_comment=field_my_comment, field_my_payment_mode=field_my_payment_mode)\n
coming_from_url = \'%s/SaleOrder_paymentRedirect?%s\' % (context.absolute_url(), parameter_string)\n
return web_site.Base_redirect(\'register\', \\\n
return web_site.Base_redirect(\'login_form\', \\\n
keep_items={\'portal_status_message\': msg,\n
\'coming_from_url\': coming_from_url})\n
\'came_from\': coming_from_url})\n
\n
if field_my_payment_mode is None:\n
if context.SaleOrder_getSelectedShippingResource() is None:\n
msg = translateString("You must select a payment mode.")\n
else:\n
if field_my_payment_mode.lower() == \'credit card\':\n
return context.getWebSectionValue().SaleOrder_viewAsWebConfirmCreditCardPayment()\n
return context.getWebSectionValue().WebSection_viewConfirmCreditCardPayment()\n
elif field_my_payment_mode.lower() == \'paypal\':\n
return context.getWebSectionValue().SaleOrder_viewAsWebConfirmPayPalPayment()\n
return context.getWebSectionValue().WebSection_viewConfirmPayPalPayment()\n
else:\n
msg = translateString("This payment mode is actually not activated, sorry: ${payment_mode}", \n
msg = translateString("This payment mode is currently not activated, sorry: ${payment_mode}", \n
mapping=dict(payment_mode=field_my_payment_mode))\n
\n
context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
context.Base_redirect(\'WebSection_viewShoppingCart\', \\\n
keep_items={\'portal_status_message\': msg})\n
</string> </value>
</item>
......
......@@ -51,11 +51,11 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Set connected user as shopping cart customer\n
Return the default trade condition for thie ecommerce site\n
"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
member = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
shopping_cart.edit(destination_section_value=member)\n
return context.getWebSiteValue().getLayoutProperty(\n
\'ecommerce_default_trade_condition\', \n
\'sale_trade_condition_module/default_trade_condition\')\n
</string> </value>
</item>
<item>
......@@ -64,11 +64,11 @@ shopping_cart.edit(destination_section_value=member)\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_setShoppingCartCustomer</string> </value>
<value> <string>WebSection_getDefaultTradeCondition</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Set shopping cart customer object</string> </value>
<value> <string>Return default trade condition</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -50,16 +50,25 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return \'%s/%s\' % (context.absolute_url(), \'SaleOrder_viewDetailAsWeb\')\n
<value> <string>"""\n
Reset section by removing shopping cart\n
"""\n
from DateTime import DateTime\n
\n
request = context.REQUEST\n
if session_id is None: \n
session_id = request.get(\'session_id\', None)\n
\n
return context.portal_sessions.manage_delObjects(session_id)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
<value> <string>session_id=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_getSaleOrderUrl</string> </value>
<value> <string>WebSection_resetShoppingCart</string> </value>
</item>
</dictionary>
</pickle>
......
<?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
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
return context.getWebSectionValue().restrictedTraverse(person_object.getRelativeUrl()).Person_viewAsWeb(context.REQUEST)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSection_viewCurrentPersonAsWeb</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -131,14 +131,14 @@ 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
came_from = kw[\'came_from\']\n
if came_from:\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
return context.REQUEST.RESPONSE.redirect(\'%s?%s\' % (came_from, parameter_string))\n
\n
return website.Base_redirect(\'\', 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
......
<?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
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
web_site = context.getWebSiteValue()\n
shopping_cart = web_site.SaleOrder_getShoppingCart()\n
empty_cart = shopping_cart.SaleOrder_isShoppingCartEmpty()\n
is_consistent = shopping_cart.SaleOrder_isConsistent()\n
is_anonymous = context.portal_membership.isAnonymousUser()\n
\n
if empty_cart:\n
return context.Base_translateString(\'Add a product to your Shopping Cart.\')\n
\n
if not is_consistent:\n
return context.Base_translateString(\'Select a Shipping Service.\')\n
\n
if is_consistent and is_anonymous:\n
return context.Base_translateString(\'Please, you must login to proceed.\')\n
\n
if is_consistent and not is_anonymous:\n
return context.Base_translateString(\'Select your billing address.\')\n
\n
return\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSite_getShoppingCartCheckoutStep</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get current Shopping Cart step for checkout procedure.</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -56,6 +56,8 @@
TODO:\n
- remove hardcoding of currency_module/EUR \n
(ex. use system properties for example)\n
\n
(rafael) We should rely on Trade Condition instead.\n
"""\n
web_site = context.getWebSiteValue()\n
return context.getPortalObject().restrictedTraverse(\n
......
<?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>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_commerce_paypal_legacy</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -60,18 +60,19 @@
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(session_id=session_id)\n
result = shopping_cart.getDestinationSectionValue()\n
if result is None:\n
shopping_cart.SaleOrder_setShoppingCartCustomer()\n
result = shopping_cart.getDestinationSectionValue()\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
result = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
shopping_cart.edit(destination_section_value=result)\n
\n
return result\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>session_id=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -72,7 +72,7 @@ shopping_cart.edit(destination_decision_value=person)\n
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Set shopping cart customer object</string> </value>
<value> <string>Set shopping cart customer object (LEGACY?)</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -36,6 +36,9 @@
<key> <string>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<tal:block tal:replace="nothing">\n
This implementation seems uncomplete and not working at all.\n
</tal:block>\n
<tal:block tal:define="base_url context/absolute_url;\n
TPE python: options.get(\'TPE\', \'my_merchant_key_location\');\n
montant python: options.get(\'total\', here.SaleOrder_getShoppingCartTotalPrice(include_shipping=True,\n
......@@ -86,7 +89,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>CyberMut button for external payment</unicode> </value>
<value> <unicode>CyberMut button for external payment (Probably Broken)</unicode> </value>
</item>
</dictionary>
</pickle>
......
......@@ -75,7 +75,7 @@
<input type="hidden" name="business" value="vincen_1247039207_biz@nexedi.com">\n
\n
<input type="hidden" name="rm" value="POST">\n
<input type="hidden" name="notify_url" tal:attributes="value python: \'%s/SaleOrder_finalizeShopping\' % (test_base_url)">\n
<input type="hidden" name="notify_url" tal:attributes="value python: \'%s/SaleOrder_finalizeShopping\' % (base_url)">\n
<input type="hidden" name="return" tal:attributes="value python: \'%s/SaleOrder_viewThankYouMessage\' % (base_url)">\n
<input type="hidden" name="cancel_return" tal:attributes="value python: \'%s?portal_status_message=Payment canceled.\' % (base_url)">\n
\n
......
......@@ -60,8 +60,10 @@ if security_parameter_dict is None:\n
security_parameter_dict[\'TOKEN\'] = token\n
security_parameter_dict[\'METHOD\'] = \'GetExpressCheckoutDetails\'\n
\n
response_parameter_dict = context.WebSection_submitPaypalNVPRequest(parameter_dict=security_parameter_dict,\n
response_parameter_dict = context.WebSection_submitPaypalNVPRequest(\n
parameter_dict=security_parameter_dict,\n
nvp_url=context.WebSite_getPaypalUrl(api=\'nvp\', alternative_url=alternative_url))\n
\n
return response_parameter_dict\n
</string> </value>
</item>
......
......@@ -68,6 +68,7 @@
- anonymous access to Sale Order Module\n
- anonymous access to sale_trade_condition_module\n
"""\n
raise ValueError("Never Run this script!")\n
translateString = context.Base_translateString \n
\n
if (context.getPortalType() != \'Web Site\'):\n
......@@ -100,7 +101,7 @@ context.setContentLayout(None)\n
context.setProperty(\'layout_additional_css\', \'mf54_commerce.css\')\n
\n
# Setup default render method for cart section\n
cart_section.setCustomRenderMethodId(\'SaleOrder_viewAsWeb\')\n
cart_section.setCustomRenderMethodId(\'WebSection_viewShoppingCart\')\n
cart_section.setProperty(\'ecommerce_default_content\', True)\n
cart_section.setProperty(\'ecommerce_product_list\', False)\n
\n
......@@ -115,7 +116,7 @@ register_section.setProperty(\'ecommerce_default_content\', True)\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_viewAsWeb\')\n
checkout_section.setProperty(\'ecommerce_default_content\', True)\n
checkout_section.setProperty(\'ecommerce_product_list\', False)\n
\n
......
......@@ -35,7 +35,7 @@
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
<value> <string>Person_editPersonalInformation</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -75,6 +75,7 @@
<value>
<list>
<string>listbox</string>
<string>submit_buttom</string>
</list>
</value>
</item>
......@@ -133,7 +134,7 @@
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>ecommerce_form_list</string> </value>
<value> <string>form_view_editable</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
......
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>submit</string> </value>
<value> <string>submit_buttom</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -101,9 +101,7 @@
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>image</string> </key>
......@@ -130,11 +128,11 @@
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string>hiddenLabel</string> </value>
<value> <string>hidden_label ecommerce_submit</string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string>Proceed to Payment</string> </value>
<value> <string>Submit</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -162,11 +160,11 @@
</item>
<item>
<key> <string>name</string> </key>
<value> <string>SaleOrder_paymentRedirect:method</string> </value>
<value> <string>Person_editPersonalInformation:method</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Pay Button</string> </value>
<value> <string>Submit</string> </value>
</item>
</dictionary>
</value>
......@@ -174,20 +172,4 @@
</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>not: here/SaleOrder_isConsistent</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -50,7 +50,19 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return \'%s/%s\' % (context.getAbsoluteUrl(), \'Resource_viewAsShop\')\n
<value> <string>"""\n
Return a URL for the product to display. If a default display\n
varition was defined by side effect, take it into account.\n
\n
TODO:\n
- make generic implementation of variation selection\n
"""\n
\n
variation = context.REQUEST.get(\'default_displayed_variation\', None)\n
if not variation:\n
return \'%s/%s\' % (context.getAbsoluteUrl(), \'Resource_viewAsShop\')\n
\n
return \'%s/%s?variation=%s\' % (context.getAbsoluteUrl(), \'Resource_viewAsShop\', variation)\n
</string> </value>
</item>
<item>
......
......@@ -53,7 +53,8 @@
<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
variation. Take a random variation (to increase site \n
appeal)\n
\n
TODO:\n
- make the variation support generic (remove hardcoded "variation"\n
......@@ -74,13 +75,24 @@ if default_image is not None:\n
return default_image.absolute_url()\n
\n
if \'variation\' in context.getVariationBaseCategoryList():\n
\n
def getDefaultVariation():\n
import random\n
default_variation = context.getVariationRangeCategoryList(base_category_list=[\'variation\'])\n
if len(default_variation):\n
default_variation = default_variation[0]\n
var_count = len(default_variation)\n
default_variation = default_variation[random.randint(0, var_count - 1)]\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
return default_image.absolute_url(), default_variation\n
return None\n
\n
from Products.ERP5Type.Cache import CachingMethod\n
url, default_variation = CachingMethod(getDefaultVariation, id=(\'Resource_getDefaultVariation2\', context.getId()), cache_factory=\'erp5_content_long\')()\n
if default_variation: \n
context.REQUEST.set(\'default_displayed_variation\', default_variation) # Pass the value to other widgets\n
return url\n
\n
return None\n
</string> </value>
......
......@@ -50,6 +50,7 @@
<value>
<list>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
......@@ -65,6 +66,14 @@
</list>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>listbox_creation_date</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
......
......@@ -362,7 +362,7 @@
<string>Price</string>
</tuple>
<tuple>
<string>SaleOrder_getFormattedCreationDate</string>
<string>creation_date</string>
<string>Order Date</string>
</tuple>
<tuple>
......@@ -411,7 +411,12 @@
<item>
<key> <string>editable_columns</string> </key>
<value>
<list/>
<list>
<tuple>
<string>creation_date</string>
<string>creation_date</string>
</tuple>
</list>
</value>
</item>
<item>
......@@ -529,7 +534,7 @@
<string>Price</string>
</tuple>
<tuple>
<string>SaleOrder_getFormattedCreationDate</string>
<string>creation_date</string>
<string>Date</string>
</tuple>
<tuple>
......@@ -562,25 +567,7 @@
<item>
<key> <string>url_columns</string> </key>
<value>
<list>
<tuple>
<string>id</string>
<string>title</string>
<string>SaleOrder_getSaleOrderUrl</string>
</tuple>
<tuple>
<string>SaleOrder_getFormattedTotalPrice</string>
<string>SaleOrder_getSaleOrderUrl</string>
</tuple>
<tuple>
<string>SaleOrder_getFormattedCreationDate</string>
<string>SaleOrder_getSaleOrderUrl</string>
</tuple>
<tuple>
<string>translated_simulation_state</string>
<string>SaleOrder_getSaleOrderUrl</string>
</tuple>
</list>
<list/>
</value>
</item>
</dictionary>
......
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>creation_date</string> </value>
<value> <string>listbox_creation_date</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -261,19 +261,13 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/SaleOrder_getFormattedCreationDate</string> </value>
<value> <string>python: cell.getCreationDate().strftime(\'%a, %d %b %Y %H:%M %p\')</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -61,10 +61,12 @@ web_site = context.getWebSiteValue()\n
resource = context.getResourceValue()\n
web_site_product_line = web_site.getLayoutProperty(\'ecommerce_base_product_line\')\n
portal_categories = context.getPortalObject().portal_categories\n
\n
base_product_line_object = portal_categories.restrictedTraverse(web_site_product_line)\n
\n
if resource in portal_categories.getRelatedValueList(base_product_line_object):\n
return \'%s/%s\' % (context.getResourceValue().getRelativeUrl(), \'Resource_viewAsShop\') \n
if resource in portal_categories.getRelatedValueList(base_product_line_object, \n
portal_type=resource.getPortalType()):\n
return \'%s/%s\' % (resource.getRelativeUrl(), \'Resource_viewAsShop\')\n
return None\n
</string> </value>
</item>
......
......@@ -41,13 +41,19 @@
<key> <string>description</string> </key>
<value> <string></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>
<value> <string>multipart/form-data</string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
......@@ -57,6 +63,7 @@
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
......@@ -67,7 +74,9 @@
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
......@@ -76,18 +85,26 @@
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>listbox_variation_title</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>shopping_cart</string>
<string>my_shipping_method</string>
<string>my_payment_mode</string>
<string>customer</string>
<string>discounts</string>
<string>comment</string>
<string>my_comment</string>
<string>submit_payment</string>
<string>header_sale_order</string>
<string>my_title</string>
<string>my_reference</string>
<string>total_price</string>
<string>my_creation_date</string>
<string>my_translated_simulation_state_title</string>
<string>my_start_date</string>
<string>my_stop_date</string>
</list>
</value>
</item>
......@@ -110,11 +127,11 @@
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Product_view</string> </value>
<value> <string>SaleOrder_view</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view_editable</string> </value>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
......@@ -126,7 +143,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Edit Shopping Cart</string> </value>
<value> <string>Sale Order</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
......@@ -136,6 +153,10 @@
<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>
......
......@@ -576,11 +576,11 @@
</tuple>
<tuple>
<string>variation_title</string>
<string>Variation</string>
<string>SaleOrder_getResourceUrl</string>
</tuple>
<tuple>
<string>getSizeTitle</string>
<string>Size</string>
<string>SaleOrder_getResourceUrl</string>
</tuple>
<tuple>
<string>getTotalQuantity</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="LabelField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>comment</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<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>extra</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>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>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</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>css_class</string> </key>
<value> <string>hiddenLabel</string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string encoding="cdata"><![CDATA[
<h2>Add A Comment</h2>
]]></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>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Add Comment</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>not: here/SaleOrder_isConsistent</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -40,19 +40,8 @@
web_site here/getWebSiteValue;\n
currency_code web_site/WebSite_getShoppingCartDefaultCurrencyCode;\n
shopping_cart_item_list shopping_cart/SaleOrder_getShoppingCartItemList;\n
empty_cart shopping_cart/SaleOrder_isShoppingCartEmpty;\n
total_price python: shopping_cart.SaleOrder_getShoppingCartTotalPrice(include_currency=False);">\n
<h2>\n
<span tal:replace="python: here.Base_translateString(\'My shopping cart\')"/>\n
</h2>\n
<h6>\n
<span tal:replace="python: web_site.WebSite_getShoppingCartCheckoutStep()"/>\n
</h6>\n
<tal:block tal:condition = "empty_cart"> \n
<h3><span tal:replace="python: here.Base_translateString(\'Your shopping cart is empty.\')"/></h3><br/>\n
</tal:block>\n
\n
<tal:block tal:condition = "not: empty_cart">\n
<div class="ListContent">\n
<table cellpadding="0" cellspacing="0" width="65%"\n
tal:define="shipping here/SaleOrder_getSelectedShippingResource">\n
......@@ -177,7 +166,6 @@
</p>\n
</tal:block>\n
</div>\n
</tal:block>\n
</tal:block>
]]></unicode> </value>
......
......@@ -50,28 +50,39 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>#TODO : USE CACHE\n
#the goal of this script is to get all the related product of this section\n
<value> <string># the goal of this script is to get all the related product of this section\n
from Products.ERP5Type.Cache import CachingMethod\n
current_web_section = context.REQUEST.get(\'current_web_section\', context)\n
product_list = []\n
\n
if not kw.has_key(\'portal_type\'):\n
kw[\'portal_type\'] = \'Product\'\n
\t \n
if not kw.has_key(\'limit\'):\t \n
kw[\'limit\'] = limit\n
\t\t \n
if not kw.has_key(\'limit\'):\t\t \n
kw[\'limit\'] = limit\t\t \n
\t\t \n
if not kw.has_key(\'all_versions\'):\t\t \n
kw[\'all_versions\'] = 1\t\t \n
if not kw.has_key(\'all_versions\'):\t \n
kw[\'all_versions\'] = 1\n
\t\t \n
if not kw.has_key(\'all_languages\'):\t\t \n
kw[\'all_languages\'] = 1\t\t \n
kw[\'all_languages\'] = 1\n
\t\t \n
for key in [\'limit\',\'all_versions\',\'all_languages\']:\t\t \n
kw[key] = int(kw[key])\t\t \n
kw[key] = int(kw[key])\n
\n
\n
def getProductList(context_relative_url, limit, all_versions, all_languages):\n
# Gabriel: The condition was added to not break the paypal return\n
# after finish the payment. The verify_sign is checked because all\n
# data from paypal have this key\n
if kw.has_key(\'quantity\') and kw.has_key("verify_sign"):\n
del kw[\'quantity\']\n
\t\t \n
product_list = current_web_section.getDocumentValueList(**kw)\n
return product_list\n
return current_web_section.getDocumentValueList(**kw)\n
\n
\n
return CachingMethod(getProductList,\n
id="WebSection_getProductList_ecommerce",\n
cache_factory=\'erp5_ui_short\')(current_web_section.getRelativeUrl(),kw[\'limit\'],kw[\'all_versions\'], kw[\'all_languages\'])\n
</string> </value>
</item>
<item>
......
......@@ -105,7 +105,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_viewAsWebConfirmCreditCardPayment</string> </value>
<value> <string>WebSection_viewCreditCardPayment</string> </value>
</item>
<item>
<key> <string>method</string> </key>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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