[Erp5-report] r31651 lucas - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplate...
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Jan 7 19:47:31 CET 2010
Author: lucas
Date: Thu Jan 7 19:47:30 2010
New Revision: 31651
URL: http://svn.erp5.org?rev=31651&view=rev
Log:
sometimes, the relation is not set on the context so the solution is to guess the accessor name from the field.
Modified:
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedDocument.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedDocument.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedDocument.xml?rev=31651&r1=31650&r2=31651&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedDocument.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedDocument.xml [utf8] Thu Jan 7 19:47:30 2010
@@ -64,11 +64,12 @@
kw = {}\n
for k, v in field.get_value(\'parameter_list\') :\n
kw[k] = v\n
-jump_reference_list = context.getAcquiredValueList(base_category, portal_type=portal_type, filter=kw)\n
+accessor_name = \'get%sValueList\' % \'\'.join([part.capitalize() for part in base_category.split(\'_\')])\n
+jump_reference_list = getattr(context, accessor_name)(portal_type=portal_type, filter=kw)\n
\n
if len(jump_reference_list)==1:\n
jump_reference = jump_reference_list[0]\n
- return request[ \'RESPONSE\' ].redirect( \'%s/view\' % jump_reference.absolute_url() )\n
+ return jump_reference.Base_redirect(\'view\')\n
else:\n
selection_uid_list = map(lambda x:x.getUid(),jump_reference_list)\n
kw = {\'uid\': selection_uid_list}\n
@@ -132,6 +133,10 @@
<string>k</string>
<string>v</string>
<string>_write_</string>
+ <string>append</string>
+ <string>$append0</string>
+ <string>part</string>
+ <string>accessor_name</string>
<string>jump_reference_list</string>
<string>len</string>
<string>_getitem_</string>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=31651&r1=31650&r2=31651&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] Thu Jan 7 19:47:30 2010
@@ -1,1 +1,1 @@
-1422
+1424
More information about the Erp5-report
mailing list