diff --git a/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/SaleOrder_getShoppingCartCustomer.xml b/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/SaleOrder_getShoppingCartCustomer.xml index b79fd5ef94eb645d67f737930fcfe012989d410a..96ea12290d728fe3ee64c8234a31e72b507770f1 100644 --- a/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/SaleOrder_getShoppingCartCustomer.xml +++ b/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/SaleOrder_getShoppingCartCustomer.xml @@ -53,30 +53,17 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string encoding="cdata"><![CDATA[ - + <value> <string># based on current Authenticated Member this script must return\n +# the Person object\n +# XXX: it must be cached.\n from Products.ERP5Type.Cache import CachingMethod\n \n user_id = context.portal_membership.getAuthenticatedMember().getId()\n if context.portal_membership.isAnonymousUser():\n return None\n \n -def getFoundUserRelativeUrl(user_id):\n - """ Find Person object by login name. """\n - user_list = context.person_module.portal_catalog(reference=user_id, \\\n - portal_type="Person")\n - if len(user_list)>0:\n - user_object = user_list[0].getObject()\n - return user_object.getRelativeUrl()\n -\n -#user_relative_url = CachingMethod(getFoundUserRelativeUrl, script.id)(user_id)\n -user_relative_url = getFoundUserRelativeUrl(user_id)\n -\n -if user_relative_url is not None:\n - return context.getPortalObject().restrictedTraverse(user_relative_url)\n - - -]]></string> </value> +return context.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue(user_name=user_id)\n +</string> </value> </item> <item> <key> <string>_code</string> </key> @@ -127,8 +114,6 @@ if user_relative_url is not None:\n <string>context</string> <string>user_id</string> <string>None</string> - <string>getFoundUserRelativeUrl</string> - <string>user_relative_url</string> </tuple> </value> </item> diff --git a/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/WebSection_viewCurrentPersonAsWeb.xml b/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/WebSection_viewCurrentPersonAsWeb.xml index eef06b3cc6d44f5ac6ea2db24353acb2a9e698e2..62ac9aba31208c116cb9642d9fb63bc0d14ea3b6 100644 --- a/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/WebSection_viewCurrentPersonAsWeb.xml +++ b/bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/WebSection_viewCurrentPersonAsWeb.xml @@ -54,7 +54,8 @@ <item> <key> <string>_body</string> </key> <value> <string>context.REQUEST.set(\'editable_mode\', 1)\n -return context.getWebSectionValue().restrictedTraverse(\'person_module/1\').Person_viewAsWeb(context.REQUEST)\n +person_object = context.getWebSiteValue().SaleOrder_getShoppingCartCustomer()\n +return context.getWebSectionValue().restrictedTraverse(person_object.getRelativeUrl()).Person_viewAsWeb(context.REQUEST)\n </string> </value> </item> <item> @@ -93,6 +94,7 @@ return context.getWebSectionValue().restrictedTraverse(\'person_module/1\').Pers <tuple> <string>_getattr_</string> <string>context</string> + <string>person_object</string> </tuple> </value> </item> diff --git a/bt5/erp5_commerce/bt/revision b/bt5/erp5_commerce/bt/revision index 1199cd493e5b0f7c20b1040406896a3f2004c700..c5a644422fb8f683632c43a9973c6f9bf3d5a12e 100644 --- a/bt5/erp5_commerce/bt/revision +++ b/bt5/erp5_commerce/bt/revision @@ -1 +1 @@ -219 \ No newline at end of file +221 \ No newline at end of file