From 36440532bae049ef0f3b650fc369796e6764522c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Mon, 31 Aug 2009 12:02:32 +0000 Subject: [PATCH] update trade condition constraints: - effective date is not required. - only perform expiration date >= effective date if both effective date and expiration date are sets. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28685 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../PropertySheet/TradeConditionConstraint.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/product/ERP5/PropertySheet/TradeConditionConstraint.py b/product/ERP5/PropertySheet/TradeConditionConstraint.py index 8e64dcc421..b330e37e2a 100644 --- a/product/ERP5/PropertySheet/TradeConditionConstraint.py +++ b/product/ERP5/PropertySheet/TradeConditionConstraint.py @@ -28,7 +28,7 @@ class TradeConditionConstraint: """ - Trade Model Line Constraints + Trade Condition Constraints """ _constraints = ( { 'id' : 'reference_existence', @@ -38,18 +38,14 @@ class TradeConditionConstraint: "message_property_not_set" : 'Reference must be defined', "message_no_such_property" : 'Reference must be defined' }, - { 'id' : 'effective_date_existence', - 'description' : 'Property start_date must be defined', - 'type' : 'PropertyExistence', - 'effective_date' : None, - 'message_property_not_set': 'Effective Date must be defined', - 'message_no_such_property' : 'Effective Date must be defined' - }, { 'id' : 'date_coherency', 'description' : 'Expiration Date must be after Effective Date', 'type' : 'TALESConstraint', - 'expression' : 'python: object.getExpirationDate() >= object.getEffectiveDate()', - 'message_expression_false': 'Expiration Date must be after Begin Date', + 'condition' : 'python: object.getExpirationDate() and ' + 'object.getEffectiveDate()' + 'expression' : 'python: object.getExpirationDate() >= ' + 'object.getEffectiveDate()', + 'message_expression_false': 'Expiration date must be after effective date', }, { 'id' : 'version_existence', 'description' : 'Version must be defined', -- 2.30.9