Commit cb145fd1 authored by Lucas Carvalho's avatar Lucas Carvalho

- Fixed all the broken templates, fields, scripts after r29103.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29105 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c0c1dd96
......@@ -195,30 +195,31 @@
"""\n
from DateTime import DateTime\n
request = context.REQUEST\n
web_site = context.getWebSiteValue()\n
isAnon = context.portal_membership.isAnonymousUser()\n
translateString = context.Base_translateString\n
shopping_cart_items = context.SaleOrder_getShoppingCartItemList(include_shipping=True)\n
shopping_cart_item_list = context.SaleOrder_getShoppingCartItemList(include_shipping=True)\n
customer = context.SaleOrder_getShoppingCartCustomer()\n
\n
if isAnon:\n
## create first an account for user\n
# create first an account for user\n
msg = translateString("You need to create an account to continue If you already have please login.")\n
context.Base_redirect(\'WebSite_viewRegistrationDialog\', \\\n
keep_items={\'portal_status_message\': msg,\n
\'editable_mode\': 1})\n
return\n
\n
## XXX: Implement check if payment is sucessfull\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.setStartDate(DateTime())\n
sale_order.setReceivedDate(DateTime())\n
\n
## set order default currency\n
sale_order.setDefaultPriceCurrency(context.SaleOrder_getShoppingCartDefaultCurrency().getRelativeUrl())\n
# set order default currency\n
sale_order.setDefaultPriceCurrency(web_site.WebSite_getShoppingCartDefaultCurrency().getRelativeUrl())\n
\n
for order_line in shopping_cart_items:\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.getResource(),\n
......@@ -226,10 +227,10 @@ for order_line in shopping_cart_items:\n
price = resource.getPrice(),\n
title = resource.getTitle())\n
\n
## order it\n
# order it\n
sale_order.order()\n
\n
## clean up shopping cart\n
# clean up shopping cart\n
context.SaleOrder_getShoppingCart(action=\'reset\')\n
\n
context.Base_redirect(\'SaleOrder_viewThankYouMessage\')\n
......@@ -279,10 +280,11 @@ context.Base_redirect(\'SaleOrder_viewThankYouMessage\')\n
<string>_getattr_</string>
<string>context</string>
<string>request</string>
<string>web_site</string>
<string>isAnon</string>
<string>translateString</string>
<string>True</string>
<string>shopping_cart_items</string>
<string>shopping_cart_item_list</string>
<string>customer</string>
<string>msg</string>
<string>sale_order_module</string>
......
......@@ -65,9 +65,10 @@
Script can optionally include currency.\n
"""\n
\n
web_site = context.getWebSiteValue()\n
total = 0.0\n
shopping_cart_items = context.SaleOrder_getShoppingCartItemList(include_shipping)\n
for order_line in shopping_cart_items:\n
shopping_cart_item_list = context.SaleOrder_getShoppingCartItemList(include_shipping)\n
for order_line in shopping_cart_item_list:\n
resource = context.restrictedTraverse(order_line.getResource())\n
if order_line.getPrice() is not None:\n
total += order_line.getPrice() * order_line.getQuantity()\n
......@@ -80,7 +81,7 @@ if include_taxes:\n
total += total*(tax_percent/100)\n
\n
if include_currency:\n
currency = context.SaleOrder_getShoppingCartDefaultCurrency()\n
currency = web_site.WebSite_getShoppingCartDefaultCurrency()\n
return \'%s %s\' %(total, currency.getReference())\n
else:\n
return str(total)\n
......@@ -131,10 +132,11 @@ else:\n
<string>include_shipping</string>
<string>include_taxes</string>
<string>include_currency</string>
<string>total</string>
<string>_getattr_</string>
<string>context</string>
<string>shopping_cart_items</string>
<string>web_site</string>
<string>total</string>
<string>shopping_cart_item_list</string>
<string>_getiter_</string>
<string>order_line</string>
<string>resource</string>
......
......@@ -57,15 +57,16 @@
if order_parameter_dict is None:\n
return None\n
\n
web_site = context.getWebSiteValue()\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
shopping_cart_product_list = shopping_cart.SaleOrder_getShoppingCartItemList()\n
shopping_cart_price = float(shopping_cart.SaleOrder_getShoppingCartTotalPrice())\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
customer = context.SaleOrder_getShoppingCartCustomer()\n
site_url = context.getWebSiteValue().absolute_url()\n
site_url = web_site.absolute_url()\n
\n
order_parameter_dict[\'METHOD\'] = \'SetExpressCheckout\'\n
order_parameter_dict[\'RETURNURL\'] = \'%s/WebSection_checkPaypalIdentification\' % site_url\n
......@@ -132,6 +133,7 @@ return order_parameter_dict\n
<string>context</string>
<string>order_parameter_dict</string>
<string>None</string>
<string>web_site</string>
<string>shopping_cart</string>
<string>shopping_cart_product_list</string>
<string>float</string>
......
......@@ -275,7 +275,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: \'%s %s\' % (here.WebSection_unrestrictedGetPrice(cell), cell.SaleOrder_getShoppingCartDefaultCurrencyCode())</string> </value>
<value> <string>python: \'%s %s\' % (here.WebSection_unrestrictedGetPrice(cell), cell.getWebSiteValue().WebSite_getShoppingCartDefaultCurrencyCode())</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -13,11 +13,11 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>default</string>
<string>whitespace_preserve</string>
<string>enabled</string>
<string>height</string>
<string>title</string>
<string>whitespace_preserve</string>
<string>width</string>
</list>
</value>
......
......@@ -311,7 +311,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(\'\', \'\')] + [( \'%s - %s %s\' %(o.getObject().getTitle(), o.getObject().getPrice(), here.SaleOrder_getShoppingCartDefaultCurrency().getTitle() ), o.getObject().getRelativeUrl(),) for o in here.SaleOrder_getAvailableShippingResourceList() if o.getObject().getPrice() is not None]</string> </value>
<value> <string>python: [(\'\', \'\')] + [( \'%s - %s %s\' %(o.getObject().getTitle(), o.getObject().getPrice(), here.getWebSiteValue().SaleOrder_getShoppingCartDefaultCurrency().getTitle() ), o.getObject().getRelativeUrl(),) for o in here.WebSite_getAvailableShippingResourceList() if o.getObject().getPrice() is not None]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -39,7 +39,8 @@
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block tal:define="shipping here/SaleOrder_getSelectedShippingResource;">\n
<tal:block tal:define="shipping here/SaleOrder_getSelectedShippingResource;\n
web_site here/getWebSiteValue;">\n
<h2>\n
<span tal:replace="python: here.Base_translateString(\'Shipping\')"/>\n
</h2>\n
......@@ -48,7 +49,7 @@
<h3> <span tal:replace="python: here.Base_translateString(\'You have not selected shipping\')"/></h3>\n
<p> \n
<span tal:replace="python: here.Base_translateString(\'Your current cart selection requires shipping. Please select shipping from\')"/>\n
<a tal:attributes="href python: \'%s/cart\' % here.getWebSiteValue().absolute_url()">here</a>.\n
<a tal:attributes="href python: \'%s/cart\' % web_site.absolute_url()">here</a>.\n
</p>\n
</tal:block>\n
\n
......@@ -58,11 +59,10 @@
<span tal:replace="shipping_obj/getTitle"/> : \n
<b>\n
<span tal:replace="shipping_obj/getPrice"/>\n
<span tal:replace="python: here.SaleOrder_getShoppingCartDefaultCurrency().getTitle()"/>\n
<span tal:replace="python: web_site.WebSite_getShoppingCartDefaultCurrency().getTitle()"/>\n
</b>\n
</p>\n
</tal:block>\n
\n
</tal:block>\n
......
......@@ -40,11 +40,12 @@
<value> <string encoding="cdata"><![CDATA[
<tal:block tal:define="shopping_cart here/SaleOrder_getShoppingCart;\n
shopping_cart_items shopping_cart/SaleOrder_getShoppingCartItemList;\n
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
empty_cart python: shopping_cart.SaleOrder_isShoppingCartEmpty();\n
confirm_mode python: bool(options.get(\'confirm_mode\', 0));\n
currency_code python: here.SaleOrder_getShoppingCartDefaultCurrencyCode();">\n
confirm_mode python: bool(options.get(\'confirm_mode\', 0));">\n
<h2>\n
<span tal:replace="python: here.Base_translateString(\'My shopping cart\')"/>\n
</h2>\n
......@@ -62,7 +63,7 @@
<td class="Data" tal:content="python: here.Base_translateString(\'Unit Price\')"/>\n
<td class="Data" tal:content="python: here.Base_translateString(\'Total\')"/>\n
</tr>\n
<tal:block tal:repeat="order_line shopping_cart_items">\n
<tal:block tal:repeat="order_line shopping_cart_item_list">\n
<tr tal:define="resource python: here.restrictedTraverse(order_line.getResource());\n
quantity python: int(order_line.getQuantity());\n
price python: resource.getPrice();\n
......
......@@ -42,17 +42,17 @@
<!-- We must change the way we get the currency on sale order -->\n
<table>\n
<tal:block tal:define="shopping_cart here/SaleOrder_getShoppingCart;\n
shopping_cart_items here/SaleOrder_getShoppingCartItemList;\n
empty_cart python: here.SaleOrder_isShoppingCartEmpty();\n
total_price python: here.SaleOrder_getShoppingCartTotalPrice(include_currency=True);\n
website python: here.getWebSiteValue();">\n
shopping_cart_item_list here/SaleOrder_getShoppingCartItemList;\n
web_site here/getWebSiteValue;\n
empty_cart here/SaleOrder_isShoppingCartEmpty;\n
total_price python: here.SaleOrder_getShoppingCartTotalPrice(include_currency=True);">\n
\n
<tr tal:repeat="order_line shopping_cart_items">\n
<td tal:define="resource python: website.restrictedTraverse(order_line.getResource());\n
<tr tal:repeat="order_line shopping_cart_item_list">\n
<td tal:define="resource python: web_site.restrictedTraverse(order_line.getResource());\n
quantity python: int(order_line.getQuantity());\n
price python: resource.getPrice();\n
currency python: shopping_cart.SaleOrder_getShoppingCartDefaultCurrency();\n
currency_symbole python: context.getPortalObject().restrictedTraverse(shopping_cart.getPriceCurrency()).getShortTitle();"\n
price resource/getPrice;\n
currency web_site/WebSite_getShoppingCartDefaultCurrency;\n
currency_symbol python: context.getPortalObject().restrictedTraverse(shopping_cart.getPriceCurrency()).getShortTitle();"\n
class="cart_top"> \n
\n
<div class="cart_left cart_item_name">\n
......@@ -63,7 +63,7 @@
</div>\n
<div class="cart_right">\n
<span>\n
<span tal:replace="python: price * quantity"/> <span tal:replace="currency_symbole"/>\n
<span tal:replace="python: price * quantity"/> <span tal:replace="currency_symbol"/>\n
</span>\n
</div> \n
</td>\n
......@@ -90,13 +90,13 @@
<td class="cart_bottom">\n
<div class="cart_left">\n
<a class="articlelink" \n
tal:attributes="href python: \'%s/%s\' % (website.absolute_url(), website.getLayoutProperty(\'ecommerce_cart_section_id\', \'\'))">\n
tal:attributes="href python: \'%s/%s\' % (web_site.absolute_url(), web_site.getLayoutProperty(\'ecommerce_cart_section_id\', \'\'))">\n
<span tal:replace="python: here.Base_translateString(\'Shopping Cart\')"/>\n
</a>\n
</div>\n
<div class="cart_right">\n
<a class="articlelink"\n
tal:attributes="href python: \'%s/%s\' % (website.absolute_url(), website.getLayoutProperty(\'ecommerce_checkout_section_id\', \'\'))">\n
tal:attributes="href python: \'%s/%s\' % (web_site.absolute_url(), web_site.getLayoutProperty(\'ecommerce_checkout_section_id\', \'\'))">\n
<span tal:replace="python: here.Base_translateString(\'Checkout\')"/>\n
</a>\n
</div>\n
......
......@@ -169,7 +169,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(i.getTitle(), i.getId()) for i in here.getPortalObject().currency_module.contentValues()]</string> </value>
<value> <string>python: [(i.getTitle(), i.getRelativeUrl()) for i in here.getPortalObject().currency_module.contentValues()]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -42,9 +42,10 @@
<div tal:repeat="product python: here.WebSection_getProductList()">\n
<div tal:condition="python: product is not None"\n
tal:define="shopping_cart here/SaleOrder_getShoppingCart;\n
site_url python:here.getWebSiteValue().absolute_url();\n
web_site here/getWebSiteValue;\n
site_url web_site/absolute_url;\n
product_href python: \'%s/product_module/%s/%s\' % (site_url, product.getId(), \'Resource_viewAsShop\');\n
currency_symbole python: context.SaleOrder_getShoppingCartDefaultCurrency().getShortTitle();"\n
currency_symbol python: web_site.WebSite_getShoppingCartDefaultCurrency().getShortTitle();"\n
tal:attributes="class python: repeat[\'product\'].index % 2 and \'product_list_bis\' or \'product_list\'">\n
<div class="product_list_left">\n
<a tal:attributes="href product_href">\n
......@@ -56,7 +57,7 @@
<div class="product_list_right">\n
<tal:block tal:define="price product/getPrice">\n
<tal:block tal:condition="python: price is not None">\n
<span>Price : </span><span tal:content="python: \'%s %s\' % (product.getPrice(), currency_symbole)">0 euros</span><br />\n
<span>Price : </span><span tal:content="python: \'%s %s\' % (product.getPrice(), currency_symbol)">0 euros</span><br />\n
</tal:block>\n
<tal:block tal:condition="python: price is None">\n
<span>The price is not setted yet.</span><br />\n
......
......@@ -42,9 +42,10 @@
<div tal:repeat="product python: here.WebSection_getProductList()">\n
<div tal:condition="python: product is not None"\n
tal:define="shopping_cart here/SaleOrder_getShoppingCart;\n
site_url python:here.getWebSiteValue().absolute_url();\n
web_site here/getWebSiteValue;\n
site_url web_site/absolute_url;\n
product_href python: \'%s/product_module/%s/%s\' % (site_url, product.getId(), \'Resource_viewAsShop\');\n
currency_symbole python: context.SaleOrder_getShoppingCartDefaultCurrency().getShortTitle();"\n
currency_symbol python: web_site.WebSite_getShoppingCartDefaultCurrency().getShortTitle();"\n
tal:attributes="class python: repeat[\'product\'].index % 2 and \'product_list_bis\' or \'product_list\'">\n
<div class="product_list_left">\n
<a tal:attributes="href product_href">\n
......@@ -56,7 +57,7 @@
<div class="product_list_right">\n
<tal:block tal:define="price product/getPrice">\n
<tal:block tal:condition="python: price is not None">\n
<span>Price : </span><span tal:content="python: \'%s %s\' % (product.getPrice(), currency_symbole)">0 euros</span><br />\n
<span>Price : </span><span tal:content="python: \'%s %s\' % (product.getPrice(), currency_symbol)" /><br />\n
</tal:block>\n
<tal:block tal:condition="python: price is None">\n
<span>The price is not setted yet.</span><br />\n
......
......@@ -54,11 +54,11 @@
- make it hierarchic\n
-->\n
</tal:block>\n
<div tal:define="web_site python: here.getWebSiteValue();\n
site_url python: web_site.absolute_url();\n
current_web_section python:request.get(\'current_web_section\', here);\n
<div tal:define="web_site here/getWebSiteValue;\n
shopping_cart here/SaleOrder_getShoppingCart;\n
currency_symbol python: shopping_cart.SaleOrder_getShoppingCartDefaultCurrencySymbol();\n
site_url web_site/absolute_url;\n
currency_symbol web_site/WebSite_getShoppingCartDefaultCurrencySymbol;\n
current_web_section python: request.get(\'current_web_section\', here);\n
product_list python: web_site.WebSite_getProductList(limit=5);"\n
i18n:translate="" i18n:domain="ui" i18n:attributes="title"\n
title="Sections accessible from here." class="selected-product">\n
......
231
\ No newline at end of file
233
\ 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