From 14aafa7e6d8a1a68914a98f680e5dd5417a7591d Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20CHAZALLET?= Date: Fri, 31 May 2013 10:22:22 +0200 Subject: [PATCH] Fin de la refonte selon le nouveau schema --- axes.py | 9 +++++++-- description.py | 5 ++--- evolution.py | 10 ++++++---- mo.py | 23 ----------------------- projet.py | 18 +++++++++++------- views/menu.xml | 11 ++--------- views/projet.xml | 17 +++++++++-------- 7 files changed, 37 insertions(+), 56 deletions(-) diff --git a/axes.py b/axes.py index 9646baf..4580fa0 100644 --- a/axes.py +++ b/axes.py @@ -154,7 +154,7 @@ class Palier(osv.Model): } -class Phase(osv.Model): +class PalierPhase(osv.Model): _name = "cmmi.axes.palier.phase" _description = "Step's phase / Phase d'un palier" @@ -174,7 +174,7 @@ class Phase(osv.Model): store=True, string="Nom de la phase"), "phase_id": fields.many2one("cmmi.projet.phase", - string="Type phase"), + string="Phase du projet"), "palier_id": fields.many2one("cmmi.axes.palier", string="Palier"), # backrefs @@ -206,6 +206,11 @@ class Chantier(osv.Model): "projet_id": fields.many2one("cmmi.projet", string="Projet", required=True), + "module_ids": fields.many2many("cmmi.description.module", + "cmmi.axes.chantier.module", + "chantier_id", + "module_id", + "Modules"), "evolutions": fields.one2many("cmmi.evolution", "chantier_id", string="Evolutions"), diff --git a/description.py b/description.py index 96516a3..9b1dd47 100644 --- a/description.py +++ b/description.py @@ -23,17 +23,16 @@ class Module(osv.Model): class Domaine(osv.Model): _name = "cmmi.description.domaine" + _description = "Table de reference des domaines" + _statuts = [("actif", "Actif"), ("inactif", "Inactif")] _columns = { "name": fields.char(string="Title", size=64, required=True), "code": fields.char(string="Code", size=8), "description": fields.text(string="Description"), - "ordre": fields.integer(string="Ordre"), "parent_id": fields.many2one("cmmi.description.domaine", string="Parent_id"), "statut": fields.selection(_statuts, string="Statut"), - "projets": fields.many2many("cmmi.projet", #TODO enlever ? - string="Projets"), } _order = "id" diff --git a/evolution.py b/evolution.py index 8594dd5..a844546 100644 --- a/evolution.py +++ b/evolution.py @@ -66,7 +66,7 @@ class Phase(osv.Model): "phase_id": fields.many2one("cmmi.axes.palier.phase", string="Phase"), "evolution_id": fields.many2one("cmmi.evolution", - string="Palier"), + string="Evolution"), } def create(self, cr, uid, vals, context=None): @@ -86,11 +86,13 @@ class Charge(osv.Model): _columns = { "name": fields.char(string="Title", size=64, required=True), "description": fields.text(string="Description"), + "evolution_id": fields.many2one("cmmi.evolution", + string="Palier"), + "phase_id": fields.many2one("cmmi.evolution.phase", + string="Phase de l'évolution", + required=True), "teammember_id": fields.many2one("res.partner", # TODO: Vers l'association teammember MO plutôt que MO. string="Team Member", required=True), - "phase_id": fields.many2one("cmmi.evolution.phase", - string="Phase de l'évolution", - required=True), } diff --git a/mo.py b/mo.py index 1726e40..431c679 100644 --- a/mo.py +++ b/mo.py @@ -28,9 +28,6 @@ class RoleMO(osv.Model): "type_mo": fields.selection(_types_mo, string="Type de MO", required=True), - "structures": fields.one2many("cmmi.mo.structure", - "role_mo_id", - string="MOs"), "mo_ids": fields.one2many("cmmi.mo", "role_mo_id", string="MOs"), @@ -79,23 +76,3 @@ class Moa(osv.Model): "moa_id", string="Projets"), } - - -class Structure(osv.Model): - - _name = "cmmi.mo.structure" - - _statuts = [("actif", "Actif"), ("inactif", "Inactif")] - - _columns = { - "name": fields.char(string="Title", size=64, required=True), - "code": fields.char(string="Code", size=8, required=True), - "description": fields.text(string="Description"), - "parent_id": fields.many2one("cmmi.mo.structure", string="Parent_id"), - "statut": fields.selection(_statuts, string="Statut"), - "role_mo_id": fields.many2one("cmmi.mo.role", string="Role MO"), - "projets": fields.many2many("cmmi.projet", - "projet_projet_structure_rel", - "structures", - string="Projets"), - } diff --git a/projet.py b/projet.py index 55e9b2d..91c6e8b 100644 --- a/projet.py +++ b/projet.py @@ -69,9 +69,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 +97,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"), @@ -366,4 +370,4 @@ class ProjetTeammember(osv.Model): "partner_id": fields.many2one("res.partner", string="Team Member", required=True), - } \ No newline at end of file + } diff --git a/views/menu.xml b/views/menu.xml index 20ff6e6..3e22d96 100644 --- a/views/menu.xml +++ b/views/menu.xml @@ -15,13 +15,7 @@ cmmi.description.domaine tree,form - + Liste des phases cmmi.phase @@ -46,8 +40,7 @@ - + diff --git a/views/projet.xml b/views/projet.xml index 2e1e7ca..babaaef 100644 --- a/views/projet.xml +++ b/views/projet.xml @@ -14,6 +14,7 @@ + + + + + + + + +

MOE