From 79663e98d293d5305cbf4b53a2271a45e4ee71e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Wed, 25 Feb 2009 15:03:10 +0000
Subject: [PATCH] make deleted and invalidated predicate never match

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25708 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_skins/erp5_pdm/SupplyCell_asPredicate.xml      | 8 ++++++--
 .../portal_skins/erp5_pdm/SupplyLine_asPredicate.xml      | 8 ++++++--
 bt5/erp5_pdm/bt/revision                                  | 2 +-
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/SupplyCell_asPredicate.xml b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/SupplyCell_asPredicate.xml
index 475d26370b..6d5f72231b 100644
--- a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/SupplyCell_asPredicate.xml
+++ b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/SupplyCell_asPredicate.xml
@@ -53,7 +53,11 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>base_category_tuple = (\'resource\',)\n
+            <value> <string>if context.getProperty(\'validation_state\') in (\'invalidated\', \'deleted\'):\n
+  # return a predicate that will never apply\n
+  return context.generatePredicate(criterion_property_list=(\'uid\',))\n
+\n
+base_category_tuple = (\'resource\',)\n
 \n
 if context.getSourceSection():\n
   base_category_tuple += (\'source_section\',)\n
@@ -110,9 +114,9 @@ return context.generatePredicate(membership_criterion_base_category_list = base_
                           <tuple>
                             <string>args</string>
                             <string>kw</string>
-                            <string>base_category_tuple</string>
                             <string>_getattr_</string>
                             <string>context</string>
+                            <string>base_category_tuple</string>
                             <string>_inplacevar_</string>
                             <string>mapped_value_property_list</string>
                           </tuple>
diff --git a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/SupplyLine_asPredicate.xml b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/SupplyLine_asPredicate.xml
index 9b45861ef2..c1421372c2 100644
--- a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/SupplyLine_asPredicate.xml
+++ b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/SupplyLine_asPredicate.xml
@@ -53,7 +53,11 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>base_category_tuple = (\'resource\',)\n
+            <value> <string>if context.getProperty(\'validation_state\') in (\'invalidated\', \'deleted\'):\n
+  # return a predicate that will never apply\n
+  return context.generatePredicate(criterion_property_list=(\'uid\',))\n
+\n
+base_category_tuple = (\'resource\',)\n
 \n
 if context.getSourceSection():\n
   base_category_tuple += (\'source_section\',)\n
@@ -111,9 +115,9 @@ return context.generatePredicate(membership_criterion_base_category_list = base_
                           <tuple>
                             <string>args</string>
                             <string>kw</string>
-                            <string>base_category_tuple</string>
                             <string>_getattr_</string>
                             <string>context</string>
+                            <string>base_category_tuple</string>
                             <string>_inplacevar_</string>
                             <string>mapped_value_property_list</string>
                           </tuple>
diff --git a/bt5/erp5_pdm/bt/revision b/bt5/erp5_pdm/bt/revision
index 2c136b29b5..58dc5afc0c 100644
--- a/bt5/erp5_pdm/bt/revision
+++ b/bt5/erp5_pdm/bt/revision
@@ -1 +1 @@
-302
\ No newline at end of file
+303
\ No newline at end of file
-- 
2.30.9