~gtg/gtg/old-trunk

« back to all changes in this revision

Viewing changes to GTG/core/task.py

  • Committer: Bertrand Rousseau
  • Date: 2012-06-09 14:33:43 UTC
  • mfrom: (1189.1.6 dates)
  • Revision ID: bertrand.rousseau@gmail.com-20120609143343-novc4s1aypad03t3
Fix for bug #826916: When planing through right-click menu, time constraints are not applied, by Nimit Shah

Show diffs side-by-side

added added

removed removed

Lines of Context:
245
245
        self.last_modified = modified
246
246
 
247
247
    def set_due_date(self, fulldate):
248
 
        self.due_date = Date(fulldate)
 
248
        self.due_date=Date(fulldate)
 
249
        if self.get_start_date() > Date(fulldate) and self.get_start_date() != Date.no_date():
 
250
            self.set_start_date(fulldate)
 
251
        if Date(fulldate)!= Date.no_date():
 
252
            for par_id in self.parents:
 
253
                par = self.req.get_task(par_id)
 
254
                if par.due_date != Date.no_date() and par.due_date < Date(fulldate):
 
255
                    par.set_due_date(fulldate)
 
256
            for sub_id in self.children:
 
257
                sub=self.req.get_task(sub_id)
 
258
                if sub.due_date > Date(fulldate) and sub.due_date != Date.no_date():
 
259
                    sub.set_due_date(fulldate)
 
260
                if sub.get_start_date() != Date.no_date() and sub.get_start_date() > Date(fulldate):
 
261
                    sub.set_start_date(fulldate)
249
262
        self.sync()
250
263
 
251
264
    def get_due_date(self):
262
275
 
263
276
    def set_start_date(self, fulldate):
264
277
        self.start_date = Date(fulldate)
 
278
        if Date(fulldate) > self.due_date and Date(fulldate) != Date.no_date():
 
279
            self.set_due_date(fulldate)
265
280
        self.sync()
266
281
 
267
282
    def get_start_date(self):