[Erp5-report] r25877 - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal_skins/er...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 5 12:38:57 CET 2009


Author: jerome
Date: Thu Mar  5 12:38:55 2009
New Revision: 25877

URL: http://svn.erp5.org?rev=25877&view=rev
Log:
when filtering entity roles, take into account that an entity can have multiple roles, and multiple roles can be used in the filter

Modified:
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getOtherPartiesReportSectionList.xml
    erp5/trunk/bt5/erp5_accounting/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getOtherPartiesReportSectionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getOtherPartiesReportSectionList.xml?rev=25877&r1=25876&r2=25877&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getOtherPartiesReportSectionList.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getOtherPartiesReportSectionList.xml [utf8] Thu Mar  5 12:38:55 2009
@@ -74,6 +74,8 @@
 # role_filter_list == None means no filter on the role\n
 if role_filter_list == [\'\'] :\n
   role_filter_list = None\n
+if role_filter_list:\n
+  role_filter_list = [\'role/%s\' % r for r in role_filter_list]\n
 \n
 result = []\n
 \n
@@ -133,7 +135,14 @@
 \n
 for party in context.Account_zDistinctSectionList():\n
   o = party.getObject()\n
-  if role_filter_list and o.getProperty(\'role\', []) not in role_filter_list:\n
+  keep_this_one = 1\n
+  if role_filter_list:\n
+    keep_this_one = 0\n
+    for role in role_filter_list:\n
+      if o.isMemberOf(role):\n
+        keep_this_one = 1\n
+\n
+  if not keep_this_one:\n
     continue\n
 \n
   if o.getPortalType() == \'Person\' or\\\n
@@ -222,16 +231,21 @@
                             <string>gap_root</string>
                             <string>True</string>
                             <string>_write_</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>_getiter_</string>
+                            <string>r</string>
                             <string>result</string>
                             <string>params</string>
                             <string>portal</string>
                             <string>simulation_tool</string>
                             <string>entity_columns</string>
                             <string>valid_node_uids</string>
-                            <string>_getiter_</string>
                             <string>account</string>
                             <string>party</string>
                             <string>o</string>
+                            <string>keep_this_one</string>
+                            <string>role</string>
                             <string>_apply_</string>
                             <string>title</string>
                             <string>_inplacevar_</string>

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=25877&r1=25876&r2=25877&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] Thu Mar  5 12:38:55 2009
@@ -1,1 +1,1 @@
-882
+883




More information about the Erp5-report mailing list