X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=projet.py;h=12ec84e1609558dec06daa592c85f1c50e8dd1a3;hb=2d45e63b968939401e2c69626b73511124b4f87d;hp=d4b951f2852294a7a91e89093438a8833b16c439;hpb=3c0e65c2c545cfcd71a52311b608cf34814284d6;p=OpenERP%2Fcmmi.git diff --git a/projet.py b/projet.py index d4b951f..12ec84e 100644 --- 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", @@ -40,6 +51,10 @@ class Projet(osv.Model): string="Evolutions"), "moe_id": fields.many2one("projet.moe", string="MoE", required=True), "moa_id": fields.many2one("projet.moa", string="MoA", required=True), + "main_domain": fields.many2one("projet.domaine", + string="Domaine principal"), + "main_structure": fields.many2one("projet.structure", + string="Structure principale"), } @@ -80,6 +95,7 @@ class Evolution(osv.Model): class Structure(osv.Model): + _name = "projet.structure" _statuts = [("actif", "Actif"), ("inactif", "Inactif")] @@ -90,6 +106,7 @@ class Structure(osv.Model): "description": fields.text(string="Description"), "parent_id": fields.many2one("projet.structure", string="Parent_id"), "statut": fields.selection(_statuts, string="Statut"), + "role_mo_id":fields.many2one("projet.role_mo", string="Role MO"), "projets": fields.many2many("projet.projet", "projet_projet_structure_rel", "structures", @@ -97,6 +114,27 @@ class Structure(osv.Model): } +class Role_MO(osv.Model): + _name = "projet.role_mo" + + _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"), + "mo_ids": fields.one2many("projet.mo", + "role_mo_id", + string="MOs"), + } + class Module(osv.Model): _name = "projet.module" @@ -169,6 +207,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"), "projet_id": fields.many2one("projet.projet", string="Projet", required=True), @@ -242,8 +282,8 @@ class Chantier(osv.Model): class Palier(osv.Model): _name = "projet.palier" - _types_palier = [("normal", "Normal"), ("exceptionnel", "Exceptionnel"), ("correctif", "Correctif"), ("autre", "Autre")] - + _types_palier = [("normal", "Normal"), ("exceptionnel", "Exceptionnel"), + ("correctif", "Correctif"), ("autre", "Autre")] _inherit = "projet.qqch" @@ -291,6 +331,7 @@ class mo(osv.Model): "name": fields.char(string="Title"), "description": fields.text(string="Description"), "chose": fields.selection(_choses, string="Chose", required=True), + "role_mo_id": fields.many2one("projet.role_mo", string="Role"), "charges": fields.one2many("projet.charge", "mo_id", string="Charges"),