Modifs sur projet
authorAlicia FLOREZ <alicflorez@gmail.com>
Mon, 29 Apr 2013 14:52:57 +0000 (16:52 +0200)
committerAlicia FLOREZ <alicflorez@gmail.com>
Mon, 29 Apr 2013 14:52:57 +0000 (16:52 +0200)
projet.py
views/projet.xml

index d805f94..7a7bed8 100644 (file)
--- a/projet.py
+++ b/projet.py
@@ -6,6 +6,7 @@ from openerp.osv import osv, fields
 from gtk import TRUE
 
 class Projet(osv.Model):
+
     _name = "projet.projet"
 
     _columns = {
@@ -19,6 +20,16 @@ class Projet(osv.Model):
                                        "projet_projet_structure_rel",
                                        "projets",
                                        string="Structures"),
+        "structures_moe": fields.many2many("projet.structure",
+                                           "projet_projet_structure_rel",
+                                           "projets",
+                                           string="Structures",
+                                           domain=[('role_mo_id.type_mo', '=', "MOE")]),
+        "structures_moa": fields.many2many("projet.structure",
+                                           "projet_projet_structure_rel",
+                                           "projets",
+                                           string="Structures",
+                                           domain=[('role_mo_id.type_mo', '=', "MOA")]),
         "team_members": fields.many2many("projet.teammember",
                                          "projet_projet_teammember_rel",
                                          "projets",
@@ -80,6 +91,7 @@ class Evolution(osv.Model):
 
 
 class Structure(osv.Model):
+
     _name = "projet.structure"
 
     _statuts = [("actif", "Actif"), ("inactif", "Inactif")]
@@ -103,12 +115,14 @@ class Role_MO(osv.Model):
 
     _statuts = [("actif", "Actif"), ("inactif", "Inactif")]
 
+    _types_mo = [("MOE", "MOE"), ("MOA", "MOA")]
 
     _columns = {
         "name": fields.char(string="Title", size=64, required=True),
         "code": fields.char(string="Code", size=8, required=True),
         "description": fields.text(string="Description"),
         "statut": fields.selection(_statuts, string="Statut"),
+        "type_mo": fields.selection(_types_mo, string="Type de MO", required=True),
         "structures": fields.one2many("projet.structure",
                                    "role_mo_id",
                                    string="MOs"),
@@ -189,7 +203,8 @@ class Phase(osv.Model):
         "name": fields.char(string="Title", size=64, required=True),
         "description": fields.text(string="Description"),
         "statut": fields.selection(_statuts, string="Statut"),
-        "type_phase_id": fields.many2one("projet.type_phase", string="Type phase"),
+        "type_phase_id": fields.many2one("projet.type_phase",
+                                         string="Type phase"),
         "projet_id": fields.many2one("projet.projet",
                                      string="Projet",
                                      required=True),
index c197a4d..9d431f7 100644 (file)
                                 <field name="moa_id" nolabel="1" />
                             </page>
                             <page string="Structures">
-                                <field name="structures" />
+                                <p>MOe</p>
+                                <field name="structures_moe" />
+                                <p>MOa</p>
+                                <field name="structures_moa" />
                             </page>
                             <page string="Team members">
                                 <field name="team_members" />
         </record>
 
 
+        <!--         VIEWS STRUCTURES         -->
+
+
+
+
         <!--         ACTIONS         -->
 
         <record model="ir.actions.act_window" id="projets_list_action">