diff --git a/product/ERP5/PropertySheet/Order.py b/product/ERP5/PropertySheet/Order.py index 866515edb3d8934e319ffae0ec7285821415a2ef..c59c8ee07f3c146d59fb157572fc880fc1a4b25e 100644 --- a/product/ERP5/PropertySheet/Order.py +++ b/product/ERP5/PropertySheet/Order.py @@ -77,4 +77,30 @@ class Order: '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', + }, )