Commit 4d23cc27 authored by Romain Courteaud's avatar Romain Courteaud

Multiple bug fixes provided by François-Xavier Algrain.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41333 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 61fbf90e
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -198,7 +195,10 @@
- B2P in EU, tax\n
"""\n
\n
return {context.Base_translateString(\'VAT\'): 20.0,}\n
return {\'VAT\': {\'translated_title\':context.Base_translateString(\'VAT\'),\n
\'percent\': 19.6,\n
},\n
}\n
</string> </value>
</item>
<item>
......@@ -264,6 +264,33 @@ return {context.Base_translateString(\'VAT\'): 20.0,}\n
<key> <string>id</string> </key>
<value> <string>Person_getApplicableTaxList</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get applicable tax information</string> </value>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -61,7 +58,7 @@
#get live description\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/pamphlet/web/short\').getUid(),\n
default_publication_section_uid=context.restrictedTraverse(\'portal_categories/publication_section/website/product/short_description\').getUid(),\n
#src__=1,\n
)\n
if web_page is None or len(web_page) == 0:\n
......@@ -133,6 +130,33 @@ return web_page[0].getObject().asStrippedHTML()\n
<key> <string>id</string> </key>
<value> <string>Product_getRelatedDescription</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -199,34 +196,45 @@ web_site = context.getWebSiteValue()\n
isAnon = context.portal_membership.isAnonymousUser()\n
translateString = context.Base_translateString\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
shopping_cart_item_list = context.SaleOrder_getShoppingCartItemList(include_shipping=True)\n
customer = context.SaleOrder_getShoppingCartCustomer()\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
\n
if isAnon:\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
web_site.Base_redirect(\'register\', \\\n
web_site.Base_redirect(\'login_form\', \\\n
keep_items={\'portal_status_message\': msg})\n
return\n
\n
# XXX: Implement check if payment is sucessfull\n
sale_order_module = context.getPortalObject().sale_order_module\n
sale_order = sale_order_module.newContent(portal_type=\'Sale Order\')\n
sale_order.setDestination(customer.getRelativeUrl())\n
sale_order.setDestinationSection(customer.getRelativeUrl())\n
sale_order.setStartDate(DateTime())\n
sale_order.setReceivedDate(DateTime())\n
sale_order.setComment(shopping_cart.getComment())\n
#Check if payment is sucessfull\n
if buyer is None:\n
raise ValueError, "Impossible to finalize and order not payed"\n
\n
# set order default currency\n
sale_order.setDefaultPriceCurrency(web_site.WebSite_getShoppingCartDefaultCurrency().getRelativeUrl())\n
portal_type = "Sale %s" % 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
# set order default currency,\n
default_price_currency = web_site.WebSite_getShoppingCartDefaultCurrency().getRelativeUrl(),\n
# set trade condition\n
specialise_value = web_site.SaleOrder_getDefaultTradeCondition()\n
)\n
\n
for order_line in shopping_cart_item_list:\n
resource = context.restrictedTraverse(order_line.getResource())\n
sale_order.newContent(portal_type = \'Sale Order Line\',\n
resource = order_line.getResourceValue()\n
sale_order.newContent(portal_type = order_line.getPortalType(),\n
resource = order_line.getResource(),\n
aggregate_list = order_line.getAggregateList(),\n
quantity = order_line.getQuantity(),\n
price = resource.getPrice(),\n
price = order_line.getPrice(),\n
title = resource.getTitle())\n
\n
# order it\n
......@@ -289,8 +297,12 @@ context.Base_redirect(\'SaleOrder_viewThankYouMessage\')\n
<string>True</string>
<string>shopping_cart_item_list</string>
<string>customer</string>
<string>buyer</string>
<string>msg</string>
<string>sale_order_module</string>
<string>None</string>
<string>ValueError</string>
<string>portal_type</string>
<string>module</string>
<string>sale_order</string>
<string>_getiter_</string>
<string>order_line</string>
......@@ -313,6 +325,33 @@ context.Base_redirect(\'SaleOrder_viewThankYouMessage\')\n
<key> <string>id</string> </key>
<value> <string>SaleOrder_finalizeShopping</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Finalize order</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>"""Return the default trade condition"""\n
default = "sale_trade_condition_module/default_trade_condition"\n
\n
website = context.getWebSiteValue()\n
if website:\n
default = website.getLayoutProperty(\'ecommerce_default_trade_condition\', default)\n
\n
return context.getPortalObject().restrictedTraverse(default)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>default</string>
<string>_getattr_</string>
<string>context</string>
<string>website</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_getDefaultTradeCondition</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -192,7 +189,9 @@
<value> <string>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.getResource()\n
return shipping_method.getResourceValue()\n
else:\n
return None\n
</string> </value>
</item>
<item>
......@@ -262,6 +261,33 @@ if shipping_method is not None:\n
<key> <string>id</string> </key>
<value> <string>SaleOrder_getSelectedShippingResource</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get selected shipping method from shopping cart</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>"""Get the shopping cart customer"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
return shopping_cart.getDestinationDecisionValue()\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>shopping_cart</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</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>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -53,9 +50,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># based on current Authenticated Member this script must return\n
# the Person object\n
return context.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue()\n
<value> <string>"""Get the shopping cart customer"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
return shopping_cart.getDestinationSectionValue()\n
</string> </value>
</item>
<item>
......@@ -100,6 +97,7 @@ return context.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue()\n
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>shopping_cart</string>
</tuple>
</value>
</item>
......@@ -118,6 +116,33 @@ return context.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue()\n
<key> <string>id</string> </key>
<value> <string>SaleOrder_getShoppingCartCustomer</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get shopping cart customer object</string> </value>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -77,8 +74,8 @@ for order_line in shopping_cart_item_list:\n
if include_taxes:\n
tax_info = context.Person_getApplicableTaxList()\n
if tax_info is not None:\n
for tax_name, tax_percent in tax_info.items():\n
total += total*(tax_percent/100)\n
for tax in tax_info.values():\n
total += total*(tax[\'percent\']/100)\n
\n
if include_currency:\n
currency = web_site.WebSite_getShoppingCartDefaultCurrency()\n
......@@ -143,8 +140,8 @@ else:\n
<string>None</string>
<string>_inplacevar_</string>
<string>tax_info</string>
<string>tax_name</string>
<string>tax_percent</string>
<string>tax</string>
<string>_getitem_</string>
<string>currency</string>
<string>str</string>
</tuple>
......@@ -169,6 +166,33 @@ else:\n
<key> <string>id</string> </key>
<value> <string>SaleOrder_getShoppingCartTotalPrice</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Calculate total price for items in shopping cart</string> </value>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -189,13 +186,23 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>\'\'\'\n
XXX: implement this check based on shopping cart content\n
for example if we sell online products there\'s no shipping. \n
<value> <string encoding="cdata"><![CDATA[
\'\'\'\n
If all product have no Weight, it don\'t need to be sheep. \n
\'\'\'\n
return False\n
shopping_cart_items = context.SaleOrder_getShoppingCartItemList()\n
\n
return 1\n
</string> </value>
weight = 0\n
for order_line in shopping_cart_items:\n
resource = order_line.getResourceValue()\n
weight += resource.getBaseWeight(0)\n
\n
return weight > 0\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -239,7 +246,17 @@ return 1\n
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple/>
<tuple>
<string>False</string>
<string>_getattr_</string>
<string>context</string>
<string>shopping_cart_items</string>
<string>weight</string>
<string>_getiter_</string>
<string>order_line</string>
<string>resource</string>
<string>_inplacevar_</string>
</tuple>
</value>
</item>
</dictionary>
......@@ -257,6 +274,33 @@ return 1\n
<key> <string>id</string> </key>
<value> <string>SaleOrder_isShippingRequired</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Is shipping required for current shopping cart?</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>"""Set connected user as shopping cart customer"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
\n
if person is None:\n
person = shopping_cart.SaleOrder_getShoppingCartCustomer()\n
\n
shopping_cart.edit(destination_decision_value=person)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>person=None</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>person</string>
<string>_getattr_</string>
<string>context</string>
<string>shopping_cart</string>
<string>None</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_setShoppingCartBuyer</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Set shopping cart customer object</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>"""Set connected user as shopping cart customer"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
member = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
shopping_cart.edit(destination_section_value=member)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>shopping_cart</string>
<string>member</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_setShoppingCartCustomer</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Set shopping cart customer object</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -66,8 +63,11 @@ if parameter_dict[\'ACK\'] != \'Success\':\n
if parameter_dict[\'PAYERID\'] != payer_id:\n
return "Identification failed.2 : %s" % parameter_dict[\'PAYERID\']\n
\n
context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
keep_items={\'portal_status_message\':translateString("Your paypal account is authentificated.", mapping = dict()),\n
#redirect user to the checkout section\n
website = context.getWebSiteValue() \n
section_url = website.getLayoutProperty(\'ecommerce_checkout_section_id\',"checkout")\n
website.Base_redirect(section_url, \\\n
keep_items={\'portal_status_message\':translateString("The payment procedure went well on Paypal."),\n
\'token\':token})\n
</string> </value>
</item>
......@@ -112,7 +112,8 @@ context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
<string>payer_id</string>
<string>parameter_dict</string>
<string>_getitem_</string>
<string>dict</string>
<string>website</string>
<string>section_url</string>
</tuple>
</value>
</item>
......@@ -131,6 +132,33 @@ context.Base_redirect(\'SaleOrder_viewAsWeb\', \\\n
<key> <string>id</string> </key>
<value> <string>WebSection_checkPaypalIdentification</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -81,6 +78,9 @@ if response_dict[\'ACK\'] != \'Success\':\n
keep_items={\'portal_status_message\': \'%s : %s\' % (msg, str(response_dict)),\n
\'editable_mode\': 1})\n
return\n
\n
#Payment is ok. Set shopping cart is payed\n
context.SaleOrder_setShoppingCartBuyer()\n
\n
return context.SaleOrder_finalizeShopping()\n
</string> </value>
......@@ -149,6 +149,33 @@ return context.SaleOrder_finalizeShopping()\n
<key> <string>id</string> </key>
<value> <string>WebSection_doPaypalPayment</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -63,8 +60,12 @@ shopping_cart_product_list = shopping_cart.SaleOrder_getShoppingCartItemList()\n
shopping_cart_price = float(web_site.SaleOrder_getShoppingCartTotalPrice())\n
taxes_amount = float(shopping_cart.SaleOrder_getShoppingCartTotalPrice(include_taxes=True, include_shipping=True)) - \\\n
float(shopping_cart.SaleOrder_getShoppingCartTotalPrice(include_shipping=True));\n
shipping = context.SaleOrder_getSelectedShippingResource()\n
shipping_price = context.restrictedTraverse(shipping).getPrice()\n
if shopping_cart.SaleOrder_isShippingRequired():\n
shipping = shopping_cart.SaleOrder_getSelectedShippingResource()\n
shipping_price = shipping.getPrice()\n
else:\n
shipping_price = 0\n
\n
customer = context.SaleOrder_getShoppingCartCustomer()\n
site_url = web_site.absolute_url()\n
\n
......@@ -72,8 +73,8 @@ order_parameter_dict[\'METHOD\'] = \'SetExpressCheckout\'\n
order_parameter_dict[\'RETURNURL\'] = \'%s/WebSection_checkPaypalIdentification\' % site_url\n
order_parameter_dict[\'CANCELURL\'] = site_url\n
order_parameter_dict[\'PAYMENTACTION\'] = \'Sale\'\n
actual_product_index = 0\n
\n
actual_product_index = 0\n
for product in shopping_cart_product_list:\n
resource = context.restrictedTraverse(product.getResource())\n
quantity = int(product.getQuantity())\n
......@@ -88,8 +89,8 @@ order_parameter_dict[\'ITEMAMT\'] = shopping_cart_price\n
order_parameter_dict[\'TAXAMT\'] = taxes_amount\n
order_parameter_dict[\'SHIPPINGAMT\'] = shipping_price\n
order_parameter_dict[\'AMT\'] = shopping_cart_price + taxes_amount + shipping_price\n
order_parameter_dict[\'CURRENCYCODE\'] = \'EUR\'\n
order_parameter_dict[\'NOSHIPPING\'] = \'1\'\n
order_parameter_dict[\'CURRENCYCODE\'] = context.WebSite_getShoppingCartDefaultCurrencyCode()\n
order_parameter_dict[\'NOSHIPPING\'] = str(not shopping_cart.SaleOrder_isShippingRequired())\n
order_parameter_dict[\'ALLOWNOTE\'] = \'0\'\n
\n
return order_parameter_dict\n
......@@ -153,6 +154,7 @@ return order_parameter_dict\n
<string>quantity</string>
<string>price</string>
<string>_inplacevar_</string>
<string>str</string>
</tuple>
</value>
</item>
......@@ -171,6 +173,33 @@ return order_parameter_dict\n
<key> <string>id</string> </key>
<value> <string>WebSite_getPaypalOrderParameterDict</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -56,7 +53,11 @@
<value> <string>""" \n
Return reference of the default currency used in Shopping Cart.\n
"""\n
return context.getWebSiteValue().WebSite_getShoppingCartDefaultCurrency().getReference()\n
website = context.getWebSiteValue()\n
if website:\n
return website.WebSite_getShoppingCartDefaultCurrency().getReference()\n
else:\n
return \'\'\n
</string> </value>
</item>
<item>
......@@ -101,6 +102,7 @@ return context.getWebSiteValue().WebSite_getShoppingCartDefaultCurrency().getRef
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>website</string>
</tuple>
</value>
</item>
......@@ -119,6 +121,33 @@ return context.getWebSiteValue().WebSite_getShoppingCartDefaultCurrency().getRef
<key> <string>id</string> </key>
<value> <string>WebSite_getShoppingCartDefaultCurrencyCode</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get default Currency symbol for Shopping Cart</string> </value>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -53,7 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return \'%s/%s\' % (context.getRelativeUrl(), \'Resource_viewAsShop\')\n
<value> <string>return \'%s/%s\' % (context.getAbsoluteUrl(), \'Resource_viewAsShop\')\n
</string> </value>
</item>
<item>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ListField" module="Products.Formulator.StandardFields"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -279,7 +276,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.SaleOrder_getSelectedShippingResource()</string> </value>
<value> <string>python: here.SaleOrder_getSelectedShippingResource().getRelativeUlr()</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -83,9 +80,7 @@
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>shipping</string>
</list>
<list/>
</value>
</item>
<item>
......@@ -95,6 +90,7 @@
<string>fake_form</string>
<string>submit</string>
<string>fake_payment</string>
<string>shipping</string>
</list>
</value>
</item>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -37,7 +34,7 @@
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<value> <unicode encoding="cdata"><![CDATA[
<tal:block tal:define="shopping_cart here/SaleOrder_getShoppingCart;\n
shopping_cart_item_list shopping_cart/SaleOrder_getShoppingCartItemList;\n
......@@ -49,7 +46,7 @@
taxes_amount python: float(shopping_cart.SaleOrder_getShoppingCartTotalPrice(include_taxes=True, include_shipping=True)) -\n
float(shopping_cart.SaleOrder_getShoppingCartTotalPrice(include_shipping=True));\n
shipping here/SaleOrder_getSelectedShippingResource;\n
shipping_price python: here.restrictedTraverse(shipping).getPrice();\n
shipping_price python: shipping.getPrice();\n
paypal_method python: \'_express-checkout\';\n
test_env python: True;\n
test_base_url python: \'http://www.dentra.net:9080/erp5\';\n
......@@ -129,7 +126,7 @@
</tal:block>\n
</tal:block>
]]></string> </value>
]]></unicode> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -143,9 +140,13 @@
<key> <string>id</string> </key>
<value> <string>SaleOrder_viewPaypalForm</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Paypal button for external payment</string> </value>
<value> <unicode>Paypal button for external payment</unicode> </value>
</item>
</dictionary>
</pickle>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -37,7 +34,7 @@
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<value> <unicode encoding="cdata"><![CDATA[
<tal:block tal:define="shipping here/SaleOrder_getSelectedShippingResource;\n
web_site here/getWebSiteValue;">\n
......@@ -55,12 +52,11 @@
</p>\n
</tal:block>\n
\n
<tal:block tal:condition="python: shipping is not None"\n
tal:define="shipping_obj python: here.restrictedTraverse(shipping);">\n
<tal:block tal:condition="python: shipping is not None">\n
<p>\n
<span tal:replace="shipping_obj/getTitle"/> : \n
<b>\n
<span tal:replace="shipping_obj/getPrice"/>\n
<span tal:replace="shipping/getPrice"/>\n
<span tal:replace="python: web_site.WebSite_getShoppingCartDefaultCurrency().getTitle()"/>\n
</b>\n
</p>\n
......@@ -68,7 +64,7 @@
</tal:block>\n
]]></string> </value>
]]></unicode> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -82,9 +78,13 @@
<key> <string>id</string> </key>
<value> <string>SaleOrder_viewShippingRenderer</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Shipping method custom renderer</string> </value>
<value> <unicode>Shipping method custom renderer</unicode> </value>
</item>
</dictionary>
</pickle>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -37,7 +34,7 @@
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<value> <unicode encoding="cdata"><![CDATA[
<tal:block tal:define="shopping_cart here/SaleOrder_getShoppingCart;\n
web_site here/getWebSiteValue;\n
......@@ -114,9 +111,8 @@
<td></td>\n
<td class="used"><span tal:replace="python: here.Base_translateString(\'Shipping Price\')"/></td>\n
<td class="used" style="vertical-align=middle;">\n
<tal:block tal:condition="python: shipping is not None"\n
tal:define="shipping_obj python: here.restrictedTraverse(shipping);">\n
<b><span tal:replace="python: \'%s %s\' % (shipping_obj.getPrice(), currency_code)"/></b>\n
<tal:block tal:condition="python: shipping is not None">\n
<b><span tal:replace="python: \'%s %s\' % (shipping.getPrice(), currency_code)"/></b>\n
</tal:block>\n
<tal:block tal:condition="python: shipping is None">\n
<b>\n
......@@ -131,15 +127,12 @@
<td></td>\n
<td class="used"><span tal:replace="python: here.Base_translateString(\'Total HT\')"/></td>\n
<td class="used" style="vertical-align=middle;">\n
<tal:block tal:define="shipping_obj python: here.restrictedTraverse(shipping);">\n
<b><span tal:replace="python: \'%s %s\' % (float(total_price) + shipping_obj.getPrice(), currency_code)"/></b>\n
</tal:block>\n
<b><span tal:replace="python: \'%s %s\' % (float(total_price) + shipping.getPrice(), currency_code)"/></b>\n
</td>\n
</tr>\n
<tr class="shopping_cart_end_lines"\n
tal:condition="python: shipping is not None"\n
tal:define="shipping here/SaleOrder_getSelectedShippingResource;\n
total_price python: here.SaleOrder_getShoppingCartTotalPrice(include_shipping=True, \n
tal:define="total_price python: here.SaleOrder_getShoppingCartTotalPrice(include_shipping=True, \n
include_taxes=True,\n
include_currency=True);">\n
<td></td>\n
......@@ -169,8 +162,8 @@
tal:define="tax_info here/Person_getApplicableTaxList">\n
<p tal:condition="python: tax_info is not None">\n
<span tal:replace="python: here.Base_translateString(\'* Applicable taxes\')"/> :\n
<tal:block tal:repeat="tax_name python: tax_info.keys()">\n
<span tal:content="python: \'%s (%s %s)\' %(tax_name, tax_info[tax_name], \'%\')">item </span>\n
<tal:block tal:repeat="tax python: tax_info.values()">\n
<span tal:content="python: \'%s (%s %s)\' %(tax[\'translated_title\'], tax[\'percent\'], \'%\')">item </span>\n
</tal:block>\n
</p>\n
<p tal:condition="python: tax_info is None">\n
......@@ -182,7 +175,7 @@
</tal:block>\n
]]></string> </value>
]]></unicode> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -196,9 +189,13 @@
<key> <string>id</string> </key>
<value> <string>SaleOrder_viewShoppingCartRenderer</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Edit/Review shopping cart content custom renderer</string> </value>
<value> <unicode>Edit/Review shopping cart content custom renderer</unicode> </value>
</item>
</dictionary>
</pickle>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -37,7 +34,7 @@
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<value> <unicode encoding="cdata"><![CDATA[
<tal:block tal:define="shipping here/SaleOrder_getSelectedShippingResource;\n
tax_info here/Person_getApplicableTaxList;\n
......@@ -51,8 +48,8 @@
<div tal:condition="python: tax_info is not None">\n
<p><span tal:replace="python: here.Base_translateString(\'For your location the following taxes are applicable\')"/> :</p>\n
<ul>\n
<tal:block tal:repeat="tax_name python: tax_info.keys()">\n
<b><li tal:content="python: \'%s (%s %s)\' %(tax_name, tax_info[tax_name], \'%\')">item </li></b>\n
<tal:block tal:repeat="tax python: tax_info.values()">\n
<b><li tal:content="python: \'%s (%s %s)\' %(tax[\'translated_title\'], tax[\'percent\'], \'%\')">item </li></b>\n
</tal:block>\n
</ul>\n
</div>\n
......@@ -69,7 +66,7 @@
</tal:block>\n
]]></string> </value>
]]></unicode> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -83,9 +80,13 @@
<key> <string>id</string> </key>
<value> <string>SaleOrder_viewTaxesRenderer</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Taxes custom renderer</string> </value>
<value> <unicode>Taxes custom renderer</unicode> </value>
</item>
</dictionary>
</pickle>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -52,7 +49,7 @@
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>normal</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
......@@ -76,7 +73,7 @@
</value>
</item>
<item>
<key> <string>left</string> </key>
<key> <string>normal</string> </key>
<value>
<list>
<string>thankyou</string>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -57,9 +54,23 @@
#the goal of this script is to get all the related product of this section\n
current_web_section = context.REQUEST.get(\'current_web_section\', context)\n
product_list = []\n
kw[\'portal_type\'] = \'Product\'\n
kw[\'limit\'] = limit\n
product_list = current_web_section.getDocumentValueList(all_versions=1, all_languages=1, **kw)\n
\n
if not kw.has_key(\'portal_type\'):\n
kw[\'portal_type\'] = \'Product\'\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
\t\t \n
if not kw.has_key(\'all_languages\'):\t\t \n
kw[\'all_languages\'] = 1\t\t \n
\t\t \n
for key in [\'limit\',\'all_versions\',\'all_languages\']:\t\t \n
kw[key] = int(kw[key])\t\t \n
\t\t \n
product_list = current_web_section.getDocumentValueList(**kw)\n
return product_list\n
</string> </value>
</item>
......@@ -121,6 +132,10 @@ return product_list\n
<string>current_web_section</string>
<string>product_list</string>
<string>_write_</string>
<string>_getiter_</string>
<string>key</string>
<string>int</string>
<string>_getitem_</string>
<string>_apply_</string>
</tuple>
</value>
......
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -92,6 +89,7 @@
<string>my_ecommerce_product_list</string>
<string>my_ecommerce_base_currency</string>
<string>my_ecommerce_payment_mode_list</string>
<string>my_ecommerce_default_trade_condition</string>
</list>
</value>
</item>
......
<?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>items</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_ecommerce_default_trade_condition</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>
<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>field_id</string> </key>
<value> <string>my_category</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</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>Default Sale Trade Condition</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>python: [(\'\', \'\')] + [(x.getTitle(), x.getRelativeUrl()) for x in here.portal_catalog(portal_type=\'Sale Trade Condition\', sort_on=((\'title\', \'ASC\'),),checked_permission=\'View\')]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,10 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -61,7 +58,9 @@
from random import choice\n
\n
web_site = context.getWebSiteValue() or context.REQUEST.get(\'current_web_site\')\n
kw[\'portal_type\'] = \'Product\'\n
\n
if not kw.has_key(\'portal_type\'):\t \t \n
kw[\'portal_type\'] = \'Product\'\n
\n
# Getting all the products from all the visible Web Section.\n
product_dict = {}\n
......@@ -153,8 +152,7 @@ return product_list\n
<string>random_uid_list</string>
<string>key_list</string>
<string>random_uid</string>
<string>append</string>
<string>$append0</string>
<string>$list0</string>
<string>uid</string>
<string>product_list</string>
</tuple>
......
271
\ No newline at end of file
272
\ 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