Commit 0cc0204e authored by Rafael Monnerat's avatar Rafael Monnerat

Revert "Add better doc strings including TODO to define future improvements"

This reverts commit 722c1b78.
parent 2d8fdf65
......@@ -51,7 +51,7 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Generate random ID which is generally used as a session ID\n
Generate random id which is generally used as a session ID.\n
"""\n
from random import choice\n
import string\n
......
......@@ -50,24 +50,13 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Edit the personal information of a client through specific form\n
which takes into account only basic personal information \n
\n
TODO:\n
- handle form validation errors after the call to\n
Base_edit (not the case currently)\n
\n
BUG:\n
- make sure personal address can be updated from\n
account page (no the case currently)\n
"""\n
<value> <string># Only save basic personal information for an ecommerce website\n
translateString = context.Base_translateString \n
\n
context.Base_edit(form_id=\'Person_viewAsWeb\')\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
keep_items={\'portal_status_message\': translateString("Your personal informations are updated.", mapping = dict())})\n
</string> </value>
</item>
<item>
......@@ -78,10 +67,6 @@ context.ERP5Site_redirect(\'%s/account\' % context.getWebSiteValue().absolute_ur
<key> <string>id</string> </key>
<value> <string>Person_editPersonalInformation</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Edit customer information</string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -187,10 +187,11 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
This script is a skeleton for implementing discounts per customer basis.\n
This script is a sceleton for implementing discounts per customer basis.\n
Because it\'s specific for every shop it needs to be implemented accordingly. \n
See also SaleOrder_viewDiscountRenderer.\n
See also SaleOrder_viewDiscountRenderer. \n
"""\n
\n
return None\n
</string> </value>
</item>
......
......@@ -187,28 +187,16 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
This script will find applicable taxes for customer based on his/her location.\n
This script will find applicable taxes for customer based on his/hers location.\n
For example.\n
- B2B in EU in same country, VAT applicable \n
- B2B in EU in different country, no VAT applicable \n
- B2B and B2C from EU to outside EU, no VAT applicable\n
- B2C in EU, VAT applicable\n
\n
TODO:\n
- use same keys as in ERP5 propertysheets (ex. ratio instead of percent)\n
- should become Resource_getApplicableTaxList and use the tax generation\n
model of ERP5 instead of ad-hoc one, maybe with some optimizations for\n
high performance price display. There is no reason to handle price\n
and tax in a different way.\n
\n
BUG:\n
- some shops are "tax inclusive" which is not currently possible and\n
prevents B2C ecommerce. Tax inclusive requires business model\n
requires a different kind of simulation rules and trade models.\n
- B2B in EU in same country, tax \n
- B2B in EU in different country, no tax \n
- B2B and B2P from EU to outside EU, no tax \n
- B2P in EU, tax\n
"""\n
\n
return {\'VAT\': {\'translated_title\':context.Base_translateString(\'VAT\'),\n
\'percent\': 19.6,\n
\'percent\': 20.,\n
},\n
}\n
</string> </value>
......
......@@ -50,34 +50,17 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Tries to find a Web Page related to the current Product\n
with publication section set to "website/product/short_description"\n
<value> <string>portal = context.getPortalObject()\n
\n
This short description made of HTML can be used to provide\n
a better description than the one provided by default on\n
the product.\n
#get cached description\n
# TODO\n
\n
TODO:\n
- use cache for description\n
- remove hardcoding by using site properties\n
- make sure we can include javascript in HTML\n
of web pages (a generic requirement which will lead\n
to changes in ERP5 TextDocument class)\n
- Rename to Resource_... since this script also\n
applied to services\n
- Handle language and version selection, possibily predicate\n
just like WebSection\n
- rename to use asHTML terminology\n
"""\n
portal = context.getPortalObject()\n
category_path = \'portal_categories/publication_section/website/product/short_description\'\n
\n
# Find a related web page with appropriate publication_section\n
#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(category_path).getUid(), # XXX Bad hardcoding\n
)\n
default_follow_up_uid=context.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
return context.Base_translateString("No more information for this product.")\n
return web_page[0].getObject().asStrippedHTML()\n
......@@ -91,10 +74,6 @@ return web_page[0].getObject().asStrippedHTML()\n
<key> <string>id</string> </key>
<value> <string>Product_getRelatedDescription</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get product description</string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -106,10 +106,6 @@ return movement\n
<key> <string>id</string> </key>
<value> <string>Resource_getPriceCalculationDefaultContext</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Build movement context to compute price</string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -188,11 +188,8 @@
<key> <string>_body</string> </key>
<value> <string>"""\n
Delete a shopping cart item.\n
\n
TODO:\n
- use form validation (Base_edit)\n
- use \'form_id\' instead of hardcoded value \'SaleOrder_viewAsWeb\'\n
"""\n
\n
translateString = context.Base_translateString\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
\n
......
......@@ -188,7 +188,7 @@
<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
Here you can check if payment was successfull or not.\n
"""\n
\n
# XXX: implement external payment check\n
......
......@@ -187,11 +187,8 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
This script return all Products which product_line category is set to \'shipping\'. \n
This will return all Products that have set product_line=\'shipping\'. XXX\n
Such products are used for shipping purposes i.e. they can not be sold.\n
\n
TODO:\n
- change hardcoded category from \'product_line\' to a site dependent category\n
"""\n
portal = context.getPortalObject()\n
\n
......
......@@ -50,9 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Return the default trade condition for thie ecommerce site\n
"""\n
<value> <string>"""Return the default trade condition"""\n
default = "sale_trade_condition_module/default_trade_condition"\n
\n
website = context.getWebSiteValue()\n
......@@ -70,10 +68,6 @@ return context.getPortalObject().restrictedTraverse(default)\n
<key> <string>id</string> </key>
<value> <string>SaleOrder_getDefaultTradeCondition</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Return default trade condition</string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -50,14 +50,7 @@
</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
<value> <string>creation_date = context.getCreationDate()\n
return creation_date.strftime(\'%a, %d %b %Y %H:%M %p\')\n
</string> </value>
</item>
......
......@@ -186,10 +186,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Return selected shipping method from shopping cart\n
"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
<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.getResourceValue()\n
......
......@@ -50,15 +50,7 @@
</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
<value> <string>"""Get the shopping cart customer"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
return shopping_cart.getDestinationDecisionValue()\n
</string> </value>
......
......@@ -50,16 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Get the shopping cart customer as a Person object. \n
\n
TODO:\n
- add some consistency checks so that if current user\n
is not the current one defined in shopping\n
cart then reset shopping cart before proceeding. This\n
could happen if a wrong sequence of logout / add to cart\n
by two people sharing the same Web browser happens.\n
"""\n
<value> <string>"""Get the shopping cart customer"""\n
shopping_cart = context.SaleOrder_getShoppingCart()\n
result = shopping_cart.getDestinationSectionValue()\n
if result is None:\n
......
......@@ -50,10 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Return shopping cart ID\n
"""\n
return context.REQUEST.get(\'session_id\')\n
<value> <string>return context.REQUEST.get(\'session_id\')\n
</string> </value>
</item>
<item>
......@@ -66,7 +63,7 @@ return context.REQUEST.get(\'session_id\')\n
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get shopping cart ID</string> </value>
<value> <string>Get shopping cart id</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -51,17 +51,10 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Return list of shopping cart items as list representing order lines.\n
\n
TODO:\n
- rename shopping_cart_order_lines to shopping_cart_order_line_list\n
- make this method compatible with cells and trees in orders. Orders\n
are not always flat. Consider large projects or matrices in B2B sales\n
of apparel. SaleOrder_getShoppingCartItemTree would be a better\n
name probably.\n
- make sure this script is not called more than once per page\n
Return list of shopping cart items.\n
XXX : get order_line as tree not just on first level\n
"""\n
shopping_cart_order_lines = context.SaleOrder_getShoppingCart().contentValues(portal_type="Sale Order Line")\n
shopping_cart_order_lines = context.SaleOrder_getShoppingCart().contentValues()\n
if include_shipping:\n
return shopping_cart_order_lines\n
else:\n
......
......@@ -61,6 +61,7 @@
\n
Script can optionally include currency.\n
"""\n
\n
web_site = context.getWebSiteValue()\n
total = 0.0\n
shopping_cart_item_list = context.SaleOrder_getShoppingCartItemList(include_shipping)\n
......
......@@ -186,15 +186,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
This method does a kind of ad-hoc consistency check\n
on the shopping cart based on the presence of a shipping method.\n
\n
TODO:\n
- use checkConsistency / fixConsistency framework of ERP5\n
(and extend it if needed with constraint categories)\n
"""\n
if context.SaleOrder_isShippingRequired() and context.SaleOrder_getSelectedShippingResource() is None:\n
<value> <string>if context.SaleOrder_isShippingRequired() and context.SaleOrder_getSelectedShippingResource() is None:\n
## shipping is required but not selected\n
return False\n
return True\n
......
......@@ -189,11 +189,7 @@
<value> <string encoding="cdata"><![CDATA[
\'\'\'\n
If all product have no weight, then it does not need to be shipped.\n
\n
TODO:\n
- use ERP5 constrain framework checkConsistency/fixConsistency\n
in order to be perfectly generic\n
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
......
......@@ -50,13 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Returns true if the shopping cart is empty\n
\n
TODO:\n
- make sure this script is not called more than once per page\n
"""\n
return len(context.SaleOrder_getShoppingCartItemList())==0\n
<value> <string>return len(context.SaleOrder_getShoppingCartItemList())==0\n
</string> </value>
</item>
<item>
......
......@@ -50,9 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Set connected user as shopping cart customer\n
"""\n
<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
......
......@@ -65,7 +65,7 @@ if parameter_dict[\'PAYERID\'] != payer_id:\n
\n
#redirect user to the checkout section\n
website = context.getWebSiteValue() \n
section_url = website.getLayoutProperty(\'ecommerce_checkout_section_id\', \'checkout\')\n
section_url = website.getLayoutProperty(\'ecommerce_checkout_section_id\',"checkout")\n
website.Base_redirect(section_url, \\\n
keep_items={\'portal_status_message\':translateString("The payment procedure went well on Paypal."),\n
\'token\':token})\n
......
......@@ -50,11 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
order_parameter_dict = context.WebSite_getPaypalOrderParameterDict()\n
<value> <string>order_parameter_dict = context.WebSite_getPaypalOrderParameterDict()\n
if order_parameter_dict is None:\n
return None\n
order_parameter_dict[\'TOKEN\'] = token\n
......
......@@ -50,11 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
request = context.REQUEST\n
<value> <string>request = context.REQUEST\n
isAnon = context.portal_membership.isAnonymousUser()\n
translateString = context.Base_translateString\n
\n
......
......@@ -50,11 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
security_parameter_dict = context.WebSite_getPaypalSecurityParameterDict()\n
<value> <string>security_parameter_dict = context.WebSite_getPaypalSecurityParameterDict()\n
if security_parameter_dict is None:\n
return None\n
security_parameter_dict[\'TOKEN\'] = token\n
......
......@@ -50,11 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
response_parameter_dict = context.WebSection_submitPaypalNVPRequest(parameter_dict=context.WebSite_getPaypalOrderParameterDict(),\n
<value> <string>response_parameter_dict = context.WebSection_submitPaypalNVPRequest(parameter_dict=context.WebSite_getPaypalOrderParameterDict(),\n
nvp_url=context.WebSite_getPaypalUrl(api=\'nvp\', alternative_url=alternative_url))\n
\n
if response_parameter_dict is None:\n
......
......@@ -50,16 +50,7 @@
</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
<value> <string>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>
......
......@@ -50,11 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
order_parameter_dict = context.WebSite_getPaypalSecurityParameterDict()\n
<value> <string>order_parameter_dict = context.WebSite_getPaypalSecurityParameterDict()\n
if order_parameter_dict is None:\n
return None\n
\n
......
......@@ -50,11 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
if context.getLayoutProperty(\'ecommerce_test_environment_enabled\', False):\n
<value> <string>if context.getLayoutProperty(\'ecommerce_test_environment_enabled\', False):\n
security_parameter_dict = {\'USER\':context.getLayoutProperty(\'ecommerce_paypal_sandbox_username\', None),\n
\'PWD\':context.getLayoutProperty(\'ecommerce_paypal_sandbox_password\', None),\n
\'SIGNATURE\':context.getLayoutProperty(\'ecommerce_paypal_sandbox_signature\', None),\n
......
......@@ -50,11 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
TODO:\n
- use generic paypal implementation of ERP5\n
"""\n
if alternative_url is not None:\n
<value> <string>if alternative_url is not None:\n
return alternative_url\n
\n
test_environement = context.getLayoutProperty(\'ecommerce_test_environment_enabled\', None)\n
......
......@@ -52,12 +52,6 @@
<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
......
......@@ -52,14 +52,9 @@
<key> <string>_body</string> </key>
<value> <string>""" \n
Return default currency used in Shopping Cart.\n
\n
TODO:\n
- remove hardcoding of currency_module/EUR \n
(ex. use system properties for example)\n
"""\n
web_site = context.getWebSiteValue()\n
return context.getPortalObject().restrictedTraverse(\n
web_site.getLayoutProperty(\'ecommerce_base_currency\', \'currency_module/EUR\'))\n
return context.getPortalObject().restrictedTraverse(web_site.getLayoutProperty(\'ecommerce_base_currency\', \'currency_module/EUR\'))\n
</string> </value>
</item>
<item>
......
......@@ -52,9 +52,6 @@
<key> <string>_body</string> </key>
<value> <string>""" \n
Return reference of the default currency used in Shopping Cart.\n
\n
TODO:\n
- add pretty printing of currency (if it makes sense here)\n
"""\n
website = context.getWebSiteValue()\n
if website:\n
......
......@@ -51,11 +51,7 @@
<item>
<key> <string>_body</string> </key>
<value> <string>""" \n
Return the short title of the default currency used in Shopping Cart.\n
\n
TODO:\n
- the currency symbol and code are used inconsistently\n
take a decision of which to use where and stick to it\n
Return the sort title of the default currency used in Shopping Cart.\n
"""\n
return context.getWebSiteValue().WebSite_getShoppingCartDefaultCurrency().getShortTitle()\n
</string> </value>
......
......@@ -50,19 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<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
<value> <string>return \'%s/%s\' % (context.getAbsoluteUrl(), \'Resource_viewAsShop\')\n
</string> </value>
</item>
<item>
......
......@@ -50,14 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
TODO:\n
- it should be possible to have more than one root\n
product lines. In such case, using a predicate would\n
be way easier.... simply by checking if the root\n
predicate(s) apply\n
"""\n
web_site = context.getWebSiteValue()\n
<value> <string>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
......
......@@ -142,7 +142,10 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -155,7 +158,10 @@
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......
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