Commit 480daf6c authored by Sebastien Robin's avatar Sebastien Robin

use new property sheet format

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43547 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1ba9c663
##############################################################################
#
# Copyright (c) 2007 Nexedi SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from Products.CMFCore.Expression import Expression
class InventoryConstraint:
"""
Inventory Constraint
"""
_constraints = (
{
'id': 'duplicate_inventory',
'type': 'DuplicateInventory',
},
{ 'id' : 'destination_category_existence',
'description' : 'Destination must be defined',
'type' : 'CategoryExistence',
'portal_type' : Expression('python: portal.getPortalNodeTypeList()'),
'destination' : 1,
'message_category_not_set': 'Wharehouse must be defined',
},
{ 'id' : 'destination_section_category_existence',
'description' : 'Destination section must be defined',
'type' : 'CategoryExistence',
'portal_type' : Expression('python: portal.getPortalNodeTypeList()'),
'destination_section' : 1,
'message_category_not_set': 'Owner must be defined',
},
{ 'id' : 'start_date',
'description' : 'Start Date must be defined',
'type' : 'PropertyExistence',
'start_date' : 1,
'message_no_such_property': 'Inventory Date must be defined',
},
{ 'id' : 'resource_on_line',
'description' : 'Resource must be defined on all lines',
'type' : 'TALESConstraint',
'expression' : 'python: None not in [x.getResourceValue() for x in object.getMovementList()]',
'message_expression_false': 'You must define a resource on all lines',
},
)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Sheet" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>InventoryConstraint</string> </value>
</item>
<item>
<key> <string>last_id</string> </key>
<value> <string>5</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Existence Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>constraint_base_category</string> </key>
<value>
<tuple>
<string>destination</string>
</tuple>
</value>
</item>
<item>
<key> <string>constraint_portal_type</string> </key>
<value> <string>python: portal.getPortalNodeTypeList()</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Destination must be defined</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>destination_category_existence_constraint</string> </value>
</item>
<item>
<key> <string>message_category_not_set</string> </key>
<value> <string>Wharehouse must be defined</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Existence Constraint</string> </value>
</item>
<item>
<key> <string>use_acquisition</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Existence Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>constraint_base_category</string> </key>
<value>
<tuple>
<string>destination_section</string>
</tuple>
</value>
</item>
<item>
<key> <string>constraint_portal_type</string> </key>
<value> <string>python: portal.getPortalNodeTypeList()</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Destination section must be defined</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>destination_section_category_existence_constraint</string> </value>
</item>
<item>
<key> <string>message_category_not_set</string> </key>
<value> <string>Owner must be defined</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Existence Constraint</string> </value>
</item>
<item>
<key> <string>use_acquisition</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Duplicate Inventory Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>duplicate_inventory_constraint</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Duplicate Inventory Constraint</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>Resource must be defined on all lines</string> </value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: None not in [x.getResourceValue() for x in object.getMovementList()]</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>resource_on_line_constraint</string> </value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>You must define a resource on all lines</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>TALES Constraint</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Existence Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>constraint_property</string> </key>
<value>
<tuple>
<string>start_date</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Start Date must be defined</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>start_date_constraint</string> </value>
</item>
<item>
<key> <string>message_no_such_property</string> </key>
<value> <string>Inventory Date must be defined</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Existence Constraint</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
1104
\ No newline at end of file
1103
\ No newline at end of file
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