From 63f243370567e0b6d2a2aa73f79a0841c2ef7582 Mon Sep 17 00:00:00 2001 From: Albert Cervera i Areny Date: Tue, 30 Apr 2013 23:46:18 +0200 Subject: [PATCH] Make leveling_delay and back_leveling_delay required Make leveling_delay and back_leveling_delay required as they are needed to compute early_start and late_finish values. issue3195 review838002 --- work.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/work.py b/work.py index 0ba1fee93d..8f77a65b91 100644 --- a/work.py +++ b/work.py @@ -34,8 +34,8 @@ class Work: ('id', '!=', Eval('id')), ], depends=['parent', 'id']) - leveling_delay = fields.Float("Leveling Delay") - back_leveling_delay = fields.Float("Back Leveling Delay") + leveling_delay = fields.Float("Leveling Delay", required=True) + back_leveling_delay = fields.Float("Back Leveling Delay", required=True) allocations = fields.One2Many('project.allocation', 'work', 'Allocations', states={ 'invisible': Eval('type') != 'task', @@ -83,6 +83,14 @@ class Work: def check_recursion(cls, records, parent='successors'): return super(Work, cls).check_recursion(records, parent=parent) + @staticmethod + def default_leveling_delay(): + return 0.0 + + @staticmethod + def default_back_leveling_delay(): + return 0.0 + @classmethod def get_function_fields(cls, works, names): '''