X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=mo.py;h=fa3599a47af70b2da9542237f7977f7f4e4dcc36;hb=9cd9465271cb7dae51c38210bc2fcb81ed4b771e;hp=1873041e26020ab2957422d6772b4a0c47e5becf;hpb=b4791d6f7f07de3f94fbbcd341628ce789f856bd;p=OpenERP%2Fcmmi.git diff --git a/mo.py b/mo.py index 1873041..fa3599a 100644 --- a/mo.py +++ b/mo.py @@ -11,10 +11,10 @@ MOA = Maîtrise d'ouvrage (ceux qui demandent et contrôlent) from openerp.osv import osv, fields -class Role_MO(osv.Model): +class RoleMO(osv.Model): """Role MO: différents types de MOE et MOA""" - _name = "projet.role_mo" + _name = "cmmi.mo.role" _statuts = [("actif", "Actif"), ("inactif", "Inactif")] @@ -25,54 +25,77 @@ class Role_MO(osv.Model): "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"), + "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"), } -class mo(osv.Model): - _name = "projet.mo" +class Mo(osv.Model): + _name = "cmmi.mo" - _choses = [("primaire", "Primaire"), - ("secondaire", "Secondaire"), - ("generique", "Générique")] + _rangs = [("primaire", "Primaire"), + ("secondaire", "Secondaire"), + ("generique", "Générique")] _columns = { "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", + "rang": fields.selection(_rangs, string="Rang", required=True), + "role_mo_id": fields.many2one("cmmi.mo.role", string="Role"), + "charges": fields.one2many("cmmi.evolution.charge", "mo_id", string="Charges"), } _defaults = { - "chose": "generique"} + "rang": "primaire"} -class moe(osv.Model): - _name = "projet.moe" - _inherit = "projet.mo" +class Moe(osv.Model): + _name = "cmmi.mo.moe" + _inherit = "cmmi.mo" _columns = { - "projets": fields.one2many("projet.projet", - "moe_id", - string="Projets"), + "projets": fields.one2many("cmmi.projet", + "moe_id", + string="Projets"), } -class moa(osv.Model): - _name= "projet.moa" - _inherit = "projet.mo" + +class Moa(osv.Model): + _name = "cmmi.mo.moa" + _inherit = "cmmi.mo" _columns = { - "projets": fields.one2many("projet.projet", - "moa_id", - string="Projets"), + "projets": fields.one2many("cmmi.projet", + "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"), }