Ajout de descriptions pour chaque classe
[OpenERP/cmmi.git] / projet.py
index 55e9b2d..1b86edf 100644 (file)
--- a/projet.py
+++ b/projet.py
@@ -9,6 +9,8 @@ class Projet(osv.Model):
 
     _name = "cmmi.projet"
 
+    _description = "Table des projets."
+
     def _get_main_domain(self, cr, uid, ids, field_name=None, arg=None, context=None):
         if type(ids) in (int, float):
             ids = [ids]
@@ -69,9 +71,16 @@ class Projet(osv.Model):
     _columns = {
         "name": fields.char(string="Title", size=64, required=True),
         "description": fields.text(string="Description"),
+        # Backrefs
         "domains": fields.one2many("cmmi.projet.domaine",
                                     "project_id",
                                     string="Domaines"),
+        "moe_ids": fields.one2many("cmmi.projet.moe",
+                                   "project_id",
+                                   string="MOEs"),
+        "moa_ids": fields.one2many("cmmi.projet.moa",
+                                   "project_id",
+                                   string="MOAs"),
         "team_members": fields.one2many("cmmi.projet.teammember",
                                          "projet_id",
                                          string="Team Members"),
@@ -90,12 +99,9 @@ class Projet(osv.Model):
         "evolutions": fields.one2many("cmmi.evolution",
                                       "projet_id",
                                       string="Evolutions"),
-        "moe_ids": fields.one2many("cmmi.projet.moe",
-                                   "project_id",
-                                   string="MOEs"),
-        "moa_ids": fields.one2many("cmmi.projet.moa",
-                                   "project_id",
-                                   string="MOAs"),
+        # TODO: faire un champs fonction qui renvoie uniquement les domaines sélectionnés
+
+        # Champs fonction rapatriant les mo ou domaine principaux
         "moe_id": fields.function(_get_main_moe,
                                   type="string",
                                   string="MOE principale"),
@@ -140,10 +146,14 @@ class Projet(osv.Model):
     def action_add_moa(self, cr, uid, ids, context=None):
         pass
 
+
+
 class ProjetDomaine(osv.Model):
 
     _name = "cmmi.projet.domaine"
 
+    _description = "Rattachement des domaines a un projet."
+
     def _get_name(self, cr, uid, ids, field_name=None, arg=None, context=None):
         if isinstance(ids, (int, long)):
             ids = [ids]
@@ -200,6 +210,8 @@ class ProjetDomaine(osv.Model):
 class ProjetMoe(osv.Model):
     _name = "cmmi.projet.moe"
 
+    _description = "Rattachement des MOEs au projet."
+
     def _get_name(self, cr, uid, ids, field_name=None, arg=None, context=None):
         if isinstance(ids, (int, long)):
             ids = [ids]
@@ -252,9 +264,12 @@ class ProjetMoe(osv.Model):
         return {'value': {'main': True}}
 
 
+
 class ProjetMoa(osv.Model):
     _name = "cmmi.projet.moa"
 
+    _description = "Rattachement des MOAs a une projet."
+
     def _get_name(self, cr, uid, ids, field_name=None, arg=None, context=None):
         if isinstance(ids, (int, long)):
             ids = [ids]
@@ -307,6 +322,7 @@ class ProjetMoa(osv.Model):
         return {'value': {'main': True}}
 
 
+
 class ProjetPhase(osv.Model):
     _name = "cmmi.projet.phase"
 
@@ -333,9 +349,12 @@ class ProjetPhase(osv.Model):
     }
 
 
+
 class ProjetTeammember(osv.Model):
     _name = "cmmi.projet.teammember"
 
+    _description = "Rattachement des Team members a un projet."
+
     def _get_partner_name(self, cr, uid, ids, field_name=None, arg=None, context=None):
         if isinstance(ids, (int, long)):
             ids = [ids]
@@ -366,4 +385,4 @@ class ProjetTeammember(osv.Model):
         "partner_id": fields.many2one("res.partner",
                                     string="Team Member",
                                     required=True),
-    }
\ No newline at end of file
+    }