Commit 633cc462 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_advanced_ecommerce&test: do not use deprecated script

parent 5acfdeff
...@@ -48,7 +48,7 @@ if not shopping_cart_id in session.keys(): ...@@ -48,7 +48,7 @@ if not shopping_cart_id in session.keys():
"Modify portal content", "Modify portal content",
"View"]) "View"])
context.WebSection_updateShoppingCartTradeCondition(shopping_cart, None) context.WebSection_updateShoppingCartTradeCondition(shopping_cart, None)
user = context.ERP5Site_getAuthenticatedMemberPersonValue() user = context.portal_membership.getAuthenticatedMember().getUserValue()
if user: if user:
shopping_cart.setDestinationValue(user) shopping_cart.setDestinationValue(user)
shopping_cart.setPriceCurrency(shopping_cart.getSpecialiseValue().getPriceCurrency()) shopping_cart.setPriceCurrency(shopping_cart.getSpecialiseValue().getPriceCurrency())
......
...@@ -112,6 +112,10 @@ ...@@ -112,6 +112,10 @@
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>autocomplete</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -154,6 +158,10 @@ ...@@ -154,6 +158,10 @@
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>max_length</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -267,7 +275,7 @@ ...@@ -267,7 +275,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.ERP5Site_getAuthenticatedMemberPersonValue().getDefaultAddressCity() or context.Base_translateString("Missing")</string> </value> <value> <string>python: here.portal_membership.getAuthenticatedMember().getUserValue().getDefaultAddressCity() or context.Base_translateString("Missing")</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -112,6 +112,10 @@ ...@@ -112,6 +112,10 @@
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>autocomplete</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -154,6 +158,10 @@ ...@@ -154,6 +158,10 @@
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>max_length</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -267,7 +275,7 @@ ...@@ -267,7 +275,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.ERP5Site_getAuthenticatedMemberPersonValue().getDefaultAddressRegionTitle() or context.Base_translateString("Missing")</string> </value> <value> <string>python: here.portal_membership.getAuthenticatedMember().getUserValue().getDefaultAddressRegionTitle() or context.Base_translateString("Missing")</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -112,6 +112,10 @@ ...@@ -112,6 +112,10 @@
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>autocomplete</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -154,6 +158,10 @@ ...@@ -154,6 +158,10 @@
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>max_length</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -267,7 +275,7 @@ ...@@ -267,7 +275,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.ERP5Site_getAuthenticatedMemberPersonValue().getDefaultAddressStreetAddress() or context.Base_translateString("Missing")</string> </value> <value> <string>python: here.portal_membership.getAuthenticatedMember().getUserValue().getDefaultAddressStreetAddress() or context.Base_translateString("Missing")</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -112,6 +112,10 @@ ...@@ -112,6 +112,10 @@
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>autocomplete</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -154,6 +158,10 @@ ...@@ -154,6 +158,10 @@
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>max_length</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -267,7 +275,7 @@ ...@@ -267,7 +275,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.ERP5Site_getAuthenticatedMemberPersonValue().getDefaultAddressZipCode() or context.Base_translateString("Missing")</string> </value> <value> <string>python: here.portal_membership.getAuthenticatedMember().getUserValue().getDefaultAddressZipCode() or context.Base_translateString("Missing")</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -112,6 +112,10 @@ ...@@ -112,6 +112,10 @@
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>autocomplete</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -154,6 +158,10 @@ ...@@ -154,6 +158,10 @@
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>max_length</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -267,7 +275,7 @@ ...@@ -267,7 +275,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.ERP5Site_getAuthenticatedMemberPersonValue().getDefaultEmailText() or context.Base_translateString("Missing")</string> </value> <value> <string>python: here.portal_membership.getAuthenticatedMember().getUserValue().getDefaultEmailText() or context.Base_translateString("Missing")</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -112,6 +112,10 @@ ...@@ -112,6 +112,10 @@
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>autocomplete</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -156,6 +160,10 @@ ...@@ -156,6 +160,10 @@
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>max_length</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -269,7 +277,7 @@ ...@@ -269,7 +277,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.ERP5Site_getAuthenticatedMemberPersonValue().getDefaultTelephoneText()</string> </value> <value> <string>python: here.portal_membership.getAuthenticatedMember().getUserValue().getDefaultTelephoneText()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -282,7 +290,7 @@ ...@@ -282,7 +290,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.ERP5Site_getAuthenticatedMemberPersonValue().getDefaultTelephoneText() is not None</string> </value> <value> <string>python: here.portal_membership.getAuthenticatedMember().getUserValue().getDefaultTelephoneText() is not None</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -112,6 +112,10 @@ ...@@ -112,6 +112,10 @@
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>autocomplete</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -154,6 +158,10 @@ ...@@ -154,6 +158,10 @@
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>max_length</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -267,7 +275,7 @@ ...@@ -267,7 +275,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.ERP5Site_getAuthenticatedMemberPersonValue().getTitle() or context.Base_translateString("Missing")</string> </value> <value> <string>python: here.portal_membership.getAuthenticatedMember().getUserValue().getTitle() or context.Base_translateString("Missing")</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -23,7 +23,7 @@ if sale_order.getSimulationState() == "draft": ...@@ -23,7 +23,7 @@ if sale_order.getSimulationState() == "draft":
for amount in sale_order.getAggregatedAmountList(): for amount in sale_order.getAggregatedAmountList():
if 'base_amount/loyalty_program/using_point' in amount.getBaseApplicationList(): if 'base_amount/loyalty_program/using_point' in amount.getBaseApplicationList():
user = context.ERP5Site_getAuthenticatedMemberPersonValue() user = context.portal_membership.getAuthenticatedMember().getUserValue()
loyalty_transaction = context.loyalty_transaction_module.newContent( loyalty_transaction = context.loyalty_transaction_module.newContent(
portal_type='Loyalty Transaction', portal_type='Loyalty Transaction',
destination_section_value=user, destination_section_value=user,
......
import random import random
translateString = context.Base_translateString translateString = context.Base_translateString
person = context.ERP5Site_getAuthenticatedMemberPersonValue() person = context.portal_membership.getAuthenticatedMember().getUserValue()
if person is None: if person is None:
......
...@@ -12,7 +12,7 @@ reference='no_loyalty_reward' ...@@ -12,7 +12,7 @@ reference='no_loyalty_reward'
if context.REQUEST.get("loyalty_reward", "") == "enable" and context.getSiteLoyaltyExplanationTemplate(): if context.REQUEST.get("loyalty_reward", "") == "enable" and context.getSiteLoyaltyExplanationTemplate():
# this is double check. # this is double check.
# a trade condition should properly configured for anonymous # a trade condition should properly configured for anonymous
if context.ERP5Site_getAuthenticatedMemberPersonValue(): if context.portal_membership.getAuthenticatedMember().getUserValue():
reference= 'loyalty_reward' reference= 'loyalty_reward'
if payment_mode: if payment_mode:
......
<tal:block tal:define="enable_reward_discount python: request.get('loyalty_reward', '') == 'enable';"> <tal:block tal:define="enable_reward_discount python: request.get('loyalty_reward', '') == 'enable';">
<div class="promotional_information" tal:condition="python: here.ERP5Site_getAuthenticatedMemberPersonValue() and here.getSiteLoyaltyExplanationTemplate()"> <div class="promotional_information" tal:condition="python: here.portal_membership.getAuthenticatedMember().getUserValue() and here.getSiteLoyaltyExplanationTemplate()">
<tal:block tal:condition="python: here.ERP5Site_getAuthenticatedMemberPersonValue().Person_getTotalLoyaltyPoint() >= 0"> <tal:block tal:condition="python: here.portal_membership.getAuthenticatedMember().getUserValue().Person_getTotalLoyaltyPoint() >= 0">
<span i18n:translate="" i18n:domain="ui">You should overwrite this page template.</span> <span i18n:translate="" i18n:domain="ui">You should overwrite this page template.</span>
<br /> <br />
<a tal:condition="python: enable_reward_discount" <a tal:condition="python: enable_reward_discount"
......
<tal:block tal:define="isAnon here/portal_membership/isAnonymousUser"> <tal:block tal:define="isAnon here/portal_membership/isAnonymousUser">
<tal:block tal:condition="not: isAnon" <tal:block tal:condition="not: isAnon"
tal:define="customer here/ERP5Site_getAuthenticatedMemberPersonValue; tal:define="customer python: here.portal_membership.getAuthenticatedMember().getUserValue();
login customer/getReference | string: ; login customer/getReference | string: ;
website here/getWebSiteValue"> website here/getWebSiteValue">
......
...@@ -314,7 +314,7 @@ ...@@ -314,7 +314,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: not here.getPortalObject().portal_membership.isAnonymousUser() and here.ERP5Site_getAuthenticatedMemberPersonValue().checkConsistency()</string> </value> <value> <string>python: not here.getPortalObject().portal_membership.isAnonymousUser() and here.portal_membership.getAuthenticatedMember().getUserValue().checkConsistency()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: not here.getPortalObject().portal_membership.isAnonymousUser() and not here.SaleOrder_isShoppingCartEmpty() and len(here.ERP5Site_getAuthenticatedMemberPersonValue().checkConsistency()) == 0 and here.SaleOrder_getSelectedShippingResource() is not None</string> </value> <value> <string>python: not here.getPortalObject().portal_membership.isAnonymousUser() and not here.SaleOrder_isShoppingCartEmpty() and len(here.portal_membership.getAuthenticatedMember().getUserValue().checkConsistency()) == 0 and here.SaleOrder_getSelectedShippingResource() is not None</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: not here.getPortalObject().portal_membership.isAnonymousUser() and not here.SaleOrder_isShoppingCartEmpty() and len(here.ERP5Site_getAuthenticatedMemberPersonValue().checkConsistency())</string> </value> <value> <string>python: not here.getPortalObject().portal_membership.isAnonymousUser() and not here.SaleOrder_isShoppingCartEmpty() and len(here.portal_membership.getAuthenticatedMember().getUserValue().checkConsistency())</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: "%s:method" % here.ERP5Site_getAuthenticatedMemberPersonValue().getRelativeUrl()</string> </value> <value> <string>python: "%s:method" % here.portal_membership.getAuthenticatedMember().getUserValue().getRelativeUrl()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -311,7 +311,7 @@ ...@@ -311,7 +311,7 @@
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
python: "<a href=%s/person_module/%s?login_come_from_url=%s> %s </a>" % (context.getWebSiteValue().absolute_url(),context.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue().getId(), context.getWebSectionValue().absolute_url(), context.Base_translateString("Change your informations")) python: "<a href=%s/person_module/%s?login_come_from_url=%s> %s </a>" % (context.getWebSiteValue().absolute_url(),context.getPortalObject().portal_membership.getAuthenticatedMember().getUserValue().getId(), context.getWebSectionValue().absolute_url(), context.Base_translateString("Change your informations"))
]]></string> </value> ]]></string> </value>
</item> </item>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</tal:block> </tal:block>
<tal:block tal:condition="not: isAnon" <tal:block tal:condition="not: isAnon"
tal:define="customer here/ERP5Site_getAuthenticatedMemberPersonValue; tal:define="customer python: here.portal_membership.getAuthenticatedMember().getUserValue();
login customer/getReference | string: ; login customer/getReference | string: ;
website here/getWebSiteValue"> website here/getWebSiteValue">
......
payment_mode = payment_mode.lower() payment_mode = payment_mode.lower()
person = context.ERP5Site_getAuthenticatedMemberPersonValue() person = context.portal_membership.getAuthenticatedMember().getUserValue()
sale_order = context.WebSection_persistShoppingCart(shopping_cart, person) sale_order = context.WebSection_persistShoppingCart(shopping_cart, person)
if payment_mode == 'paypal': if payment_mode == 'paypal':
......
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