Commit 39a812b4 authored by Jérome Perrin's avatar Jérome Perrin

Use glossary terms in constraint messages, and split the general constraint for

source, source_section, destination and destination_section in 4 constraints to
have better messages.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20981 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e9cd5a7e
...@@ -39,14 +39,33 @@ class TradeOrder: ...@@ -39,14 +39,33 @@ class TradeOrder:
) )
_constraints = ( _constraints = (
{ 'id' : 'category_existence', { 'id' : 'source_section_category_existence',
'description' : 'Source, Destination and Sections must be defined', 'description' : 'Source section must be defined',
'type' : 'CategoryExistence', 'type' : 'CategoryExistence',
'portal_type' : ('Person', 'Organisation'), 'portal_type' : ('Person', 'Organisation'),
'source' : 1,
'destination' : 1,
'source_section': 1, 'source_section': 1,
'message': 'Supplier must be defined',
},
{ 'id' : 'destination_section_category_existence',
'description' : 'Destination section must be defined',
'type' : 'CategoryExistence',
'portal_type' : ('Person', 'Organisation'),
'destination_section': 1, 'destination_section': 1,
'message': 'Client must be defined',
},
{ 'id' : 'source_category_existence',
'description' : 'Source must be defined',
'type' : 'CategoryExistence',
'portal_type' : ('Person', 'Organisation'),
'source': 1,
'message': 'Sender or Provider must be defined',
},
{ 'id' : 'destination_category_existence',
'description' : 'Destination must be defined',
'type' : 'CategoryExistence',
'portal_type' : ('Person', 'Organisation'),
'destination': 1,
'message': 'Recipient or Beneficiary must be defined',
}, },
{ 'id' : 'total_quantity', { 'id' : 'total_quantity',
'description' : 'Total Quantity must not be 0', 'description' : 'Total Quantity must not be 0',
......
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