From 4a1e76ef596cd9e1124a7c9e8aecf958a3a2446b Mon Sep 17 00:00:00 2001
From: Yusei Tahara <yusei@nexedi.com>
Date: Wed, 19 Oct 2016 15:44:16 +0900
Subject: [PATCH] erp5_property_sheets: Ignore documents in cancelled or
 deleted validation state.

---
 .../assignor_existence_constraint.xml         | 44 ++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/DocumentConstraint/assignor_existence_constraint.xml b/product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/DocumentConstraint/assignor_existence_constraint.xml
index d34fe30a3a..e303285ec3 100644
--- a/product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/DocumentConstraint/assignor_existence_constraint.xml
+++ b/product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/DocumentConstraint/assignor_existence_constraint.xml
@@ -6,6 +6,18 @@
     </pickle>
     <pickle>
       <dictionary>
+        <item>
+            <key> <string>_identity_criterion</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_range_criterion</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
         <item>
             <key> <string>description</string> </key>
             <value> <string>Documents should have one group or use one project as                       Follow Up relation</string> </value>
@@ -14,7 +26,7 @@
             <key> <string>expression</string> </key>
             <value> <string encoding="cdata"><![CDATA[
 
-python: len(object.getFollowUpList()) > 0 \t              or len(object.getGroupList()) > 0 or \t\t      object.getValidationState() == "embedded"
+python: len(object.getFollowUpList()) > 0 \t              or len(object.getGroupList()) > 0 or \t\t      object.getValidationState() in ("embedded", "cancelled", "deleted")
 
 ]]></string> </value>
         </item>
@@ -33,4 +45,34 @@ python: len(object.getFollowUpList()) > 0 \t              or len(object.getGroup
       </dictionary>
     </pickle>
   </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <global name="PersistentMapping" module="Persistence.mapping"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <global name="PersistentMapping" module="Persistence.mapping"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
 </ZopeData>
-- 
2.30.9