lab.nexedi.com will be down from Thursday, 20 March 2025, 07:30:00 UTC for a duration of approximately 2 hours

Commit b710adcd authored by Jérome Perrin's avatar Jérome Perrin

remove hardcoded state checks, this is not flexible and afterall not really

needed here. (Thanks Romain for pointing this out)



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21054 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fa981ffb
......@@ -37,27 +37,21 @@ class CalendarConstraint:
'type' : 'ContentExistence',
'portal_type' : ('Presence Request Period', ),
'description' : 'No Presence Request Period created yet',
'condition' : 'python: object.getPortalType() == "Presence Request"'
' and object.getSimulationState() not'
' in ("cancelled", "deleted")',
'condition' : 'python: object.getPortalType() == "Presence Request"',
},
{ 'id' : 'leave_request_line',
'description' : 'Must contain at least one period',
'type' : 'ContentExistence',
'portal_type' : ('Leave Request Period', ),
'description' : 'No Leave Request Period created yet',
'condition' : 'python: object.getPortalType() == "Leave Request"'
' and object.getSimulationState() not'
' in ("cancelled", "deleted")',
'condition' : 'python: object.getPortalType() == "Leave Request"',
},
{ 'id' : 'group_request_line',
'description' : 'Must contain at least one period',
'type' : 'ContentExistence',
'portal_type' : ('Group Leave Period', 'Group Presence Period', ),
'description' : 'No Group Presence Period created yet',
'condition' : 'python: object.getPortalType() == "Group Calendar"'
' and object.getSimulationState() not'
' in ("cancelled", "deleted")',
'description' : 'No Calendar Line created yet',
'condition' : 'python: object.getPortalType() == "Group Calendar"',
},
)
......@@ -37,8 +37,6 @@ class CalendarPeriodConstraint:
'description': 'Date must be defined',
'message_property_not_set': 'Start date must be defined',
'message_no_such_property': 'Start date must be defined',
'condition' : 'python: object.getSimulationState() not'
' in ("cancelled", "deleted")',
'type': 'PropertyExistence',
'start_date' : 1,
},
......@@ -47,19 +45,14 @@ class CalendarPeriodConstraint:
'description': 'Date must be defined',
'message_property_not_set': 'Stop date must be defined',
'message_no_such_property': 'Stop date must be defined',
'condition' : 'python: object.getSimulationState() not'
' in ("cancelled", "deleted")',
'type': 'PropertyExistence',
'stop_date' : 1,
},
{ 'id': 'resource_existence',
'description': 'Type must be defined',
'message_category_not_set':
'Type must be defined',
'message_category_not_set': 'Type must be defined',
'portal_type': (),
'condition' : 'python: object.getSimulationState() not'
' in ("cancelled", "deleted")',
'type': 'CategoryExistence',
'resource' : 1,
},
......
......@@ -35,11 +35,8 @@ class IndividualCalendarConstraint:
{ 'id': 'destination_existance',
'description': 'Person must be defined',
'message_category_not_set':
'Person must be defined',
'message_category_not_set': 'Person must be defined',
'portal_type': ('Person',),
'condition' : 'python: object.getSimulationState() not'
' in ("cancelled", "deleted")',
'type': 'CategoryExistence',
'destination' : 1,
},
......
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