X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=projet.py;h=4e2e7a612b636bd5b99684394a93271439790070;hb=d1bd85260bc75d06ee99219c80056f40f96fbddc;hp=454682b8c787bbc117f1c828efaaf93c5c78e31a;hpb=c138aeffc48b73e3485f745e56b8e58206950ae8;p=OpenERP%2Fcmmi.git diff --git a/projet.py b/projet.py index 454682b..4e2e7a6 100644 --- a/projet.py +++ b/projet.py @@ -9,25 +9,12 @@ class Projet(osv.Model): _name = "cmmi.projet" - _domains = { - 'moe': [('role_mo_id.type_mo', '=', "MOE")], - 'moa': [('role_mo_id.type_mo', '=', "MOA")], - } - _columns = { "name": fields.char(string="Title", size=64, required=True), "description": fields.text(string="Description"), "domaines": fields.one2many("cmmi.projet.domaine", "project_id", string="Domaines"), - "structures": fields.many2many("cmmi.mo.structure", - string="Structures"), - "structures_moe": fields.many2many("cmmi.mo.structure", - string="Structures", - domain=_domains['moe']), - "structures_moa": fields.many2many("cmmi.mo.structure", - string="Structures", - domain=_domains['moa']), "team_members": fields.many2many("cmmi.partner.teammember", "cmmi_projet_teammember_rel", "projet_id", @@ -48,12 +35,24 @@ class Projet(osv.Model): "evolutions": fields.one2many("cmmi.evolution", "projet_id", string="Evolutions"), - "moe_id": fields.many2one("cmmi.mo.moe", string="MoE", required=True), - "moa_id": fields.many2one("cmmi.mo.moa", string="MoA", required=True), - "main_domain": fields.many2one("cmmi.description.domaine", - string="Domaine principal"), - "main_structure": fields.many2one("cmmi.mo.structure", - string="Structure principale"), + "moe_ids": fields.one2many("cmmi.projet.moe", + "project_id", + string="MOEs"), + "moa_ids": fields.one2many("cmmi.projet.moa", + "project_id", + string="MOAs"), + "moe_id": fields.one2many("cmmi.projet.moe", + "project_id", + string="MOE principale", + domaine=[('main', '=', True)]), + "moa_id": fields.one2many("cmmi.projet.moa", + "project_id", + string="MOA principale", + domaine=[('main', '=', True)]), + "main_domain": fields.one2many("cmmi.projet.domaine", + "project_id", + string="Domaine principal", + domaine=[('main', '=', True)]), } def action_add_domain(self, cr, uid, ids, context=None): @@ -143,9 +142,12 @@ class ProjetMoe(osv.Model): string="MOE"), } + def onchange_main(self, cr, uid, ids, project, moe, main, context=None): + pass + class ProjetMoa(osv.Model): - _name = "cmmi.projet.moe" + _name = "cmmi.projet.moa" def _get_name(self, cr, uid, ids, field_name=None, arg=None, context=None): if isinstance(ids, (int, long)): @@ -165,6 +167,9 @@ class ProjetMoa(osv.Model): string="MOA"), } + def onchange_main(self, cr, uid, ids, project, moa, main, context=None): + pass + class ProjetPhase(osv.Model): _name = "cmmi.projet.phase"