Modification contraintes : planned <= milestone et target <= milestone
[OpenERP/todolist.git] / todolist.py
index 5d0c666..57adec9 100644 (file)
@@ -58,6 +58,8 @@ class Container(osv.Model):
 
     _name = "todolist.container"
 
+    _inherit = "mail.thread"
+
     _status = [("draft", "Draft"), ("pending", "Pending"), ("done", "Done")]
 
     _columns = {
@@ -86,7 +88,7 @@ class Container(osv.Model):
         ),
         (
             "target_before_milestone_constraint",
-            "CHECK(target < milestone)",
+            "CHECK(target <= milestone)",
             "The target date should be previous milestone date",
         ),
     ]
@@ -120,6 +122,8 @@ class Task(osv.Model):
 
     _name = "todolist.task"
 
+    _inherit = "mail.thread"
+
     _priorities = [("Useful", "Useful"), ("Necessary", "Necessary"), ("Essential", "Essential")]
 
     _states = [("draft", "Draft"), ("proposal", "Proposal"), ("approved", "Approved"), ("started", "Started"), ("done", "Done")]
@@ -150,12 +154,12 @@ class Task(osv.Model):
         ),
         (
             "planned_before_milestone_constraint",
-            "CHECK(planned < milestone)",
+            "CHECK(planned <= milestone)",
             "The planned date should be previous milestone date",
         ),
         (
             "manday_sup_0_constraint",
-            "CHECK(manday > 0)",
+            "CHECK(manday >= 0)",
             "The manday should be positive",
         ),
     ]
@@ -237,6 +241,8 @@ class Topic(osv.Model):
 
     _name = "todolist.topic"
 
+    _inherit = "mail.thread"
+
     _states = [("Active", "Active"), ("Inactive", "Inactive")]
 
     _columns = {