add planned delivery column
authorKatia Saurfelt <katia.saurfelt@logilab.fr>
Tue, 14 Apr 2009 12:10:09 +0200
changeset 1346 38b2cf1b0bb8
parent 1334 0d63ee3096f6
child 1347 01210bb805dc
add planned delivery column
web/views/iprogress.py
--- a/web/views/iprogress.py	Fri Apr 10 11:51:13 2009 +0200
+++ b/web/views/iprogress.py	Tue Apr 14 12:10:09 2009 +0200
@@ -40,7 +40,7 @@
     accepts_interfaces = (IMileStone,)
 
     # default columns of the table
-    columns = (_('project'), _('milestone'), _('state'), _('eta_date'),
+    columns = (_('project'), _('milestone'), _('state'), _('eta_date'), _('planned_delivery'),
                _('cost'), _('progress'), _('todo_by'))
 
 
@@ -133,6 +133,12 @@
             else:
                 formated_date = u'%s %s' % (_('expected:'), eta_date)
         return formated_date
+
+    def build_planned_delivery_cell(self, entity):
+        """``initial_prevision_date`` column cell renderer"""
+        if entity.finished():
+            return self.format_date(entity.completion_date())
+        return self.format_date(entity.initial_prevision_date())
     
     def build_todo_by_cell(self, entity):
         """``todo_by`` column cell renderer"""