From f20f24b9714c932ecf0017dfeecd14fd58b60c5d Mon Sep 17 00:00:00 2001
From: Thibaut Deheunynck <thibaut@nexedi.com>
Date: Thu, 14 Aug 2008 12:06:38 +0000
Subject: [PATCH] thibaut improve constraint for M0 form and P0 form

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22995 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../PropertySheetTemplateItem/M0Constraint.py             | 5 -----
 .../PropertySheetTemplateItem/P0Constraint.py             | 8 ++++++++
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/bt5/erp5_registry_ohada/PropertySheetTemplateItem/M0Constraint.py b/bt5/erp5_registry_ohada/PropertySheetTemplateItem/M0Constraint.py
index 8c5e47fd58..ea0b2a36aa 100644
--- a/bt5/erp5_registry_ohada/PropertySheetTemplateItem/M0Constraint.py
+++ b/bt5/erp5_registry_ohada/PropertySheetTemplateItem/M0Constraint.py
@@ -70,11 +70,6 @@ class M0Constraint:
       'type'          : 'PropertyExistence',
       'activity_free_text': None, 
     },
-    { 'id'            : 'beginning_date_existence',
-      'description'   : 'Property beginning_date must be definied',
-      'type'          : 'PropertyExistence',
-      'beginning_date': None, 
-    }, 
     { 'id'            : 'first_administrator_lastname_existence',
       'description'   : 'Property first_administrator_lastname must be definied',
       'type'          : 'PropertyExistence',
diff --git a/bt5/erp5_registry_ohada/PropertySheetTemplateItem/P0Constraint.py b/bt5/erp5_registry_ohada/PropertySheetTemplateItem/P0Constraint.py
index e053005a28..cdb3897341 100644
--- a/bt5/erp5_registry_ohada/PropertySheetTemplateItem/P0Constraint.py
+++ b/bt5/erp5_registry_ohada/PropertySheetTemplateItem/P0Constraint.py
@@ -160,4 +160,12 @@ class P0Constraint:
       'inscription_check'     : None,
       'condition'     : 'python: object.getRccmCheck() == None',
     },
+    { 'id'            : 'previous_activity_corporate_registration_code_existence',
+      'description'   : 'Property must be definied',
+      'type'          : 'PropertyExistence',
+      'previous_activity_corporate_registration_code'     : None,
+      'condition'     : 'python: object.getActivityRestartCheck() != None',
+      'message_no_such_property': 'for a restart activity you must define the previous registration code',
+      'message_property_not_set': 'for a restart activity you must define the previous registration code',
+    },
   )
-- 
2.30.9