Commit 09289006 authored by Alexandre Boeglin's avatar Alexandre Boeglin

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


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19790 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2e6aabd9
...@@ -77,4 +77,30 @@ class Order: ...@@ -77,4 +77,30 @@ class Order:
'portal_type' : ('Applied Rule', ), 'portal_type' : ('Applied Rule', ),
'base_category' : ('causality',) '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',
},
) )
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment