[Erp5-report] r19790 - /erp5/trunk/products/ERP5/PropertySheet/Order.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Mar 11 14:37:59 CET 2008


Author: alex
Date: Tue Mar 11 14:37:59 2008
New Revision: 19790

URL: http://svn.erp5.org?rev=19790&view=rev
Log:
add some contraints to order:
- Source, Destination and Sections must be defined
- Total Quantity must not be 0
- Start Date must be defined
- Stop Date must be after Start Date

Modified:
    erp5/trunk/products/ERP5/PropertySheet/Order.py

Modified: erp5/trunk/products/ERP5/PropertySheet/Order.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/PropertySheet/Order.py?rev=19790&r1=19789&r2=19790&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/PropertySheet/Order.py (original)
+++ erp5/trunk/products/ERP5/PropertySheet/Order.py Tue Mar 11 14:37:59 2008
@@ -77,4 +77,30 @@
       'portal_type'   : ('Applied Rule', ),
       'base_category' : ('causality',)
     },
+    { 'id'            : 'category_existence',
+      'description'   : 'Source, Destination and Sections must be defined',
+      'type'          : 'CategoryExistence',
+      'portal_type'   : ('Person', 'Organisation'),
+      'source'        : 1,
+      'destination'        : 1,
+      'source_section': 1,
+      'destination_section': 1,
+    },
+    { 'id'            : 'total_quantity',
+      'description'   : 'Total Quantity must not be 0',
+      'type'          : 'TALESConstraint',
+      'expression'    : 'python: object.getTotalQuantity() > 0',
+      'message_expression_false': 'Total Quantity must not be 0',
+    },
+    { 'id'            : 'start_date',
+      'description'   : 'Start Date must be defined',
+      'type'          : 'PropertyExistence',
+      'start_date'    : 1,
+    },
+    { 'id'            : 'date_coherency',
+      'description'   : 'Stop Date must be after Start Date',
+      'type'          : 'TALESConstraint',
+      'expression'    : 'python: object.getStopDate() >= object.getStartDate()',
+      'message_expression_false': 'Stop Date must be after Start Date',
+    },
    )




More information about the Erp5-report mailing list