From d1bd85260bc75d06ee99219c80056f40f96fbddc Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20CHAZALLET?= Date: Thu, 23 May 2013 16:01:24 +0200 Subject: [PATCH] Modifications importantes sur MOA et MOE --- demo/projet.xml | 4 ++-- projet.py | 45 +++++++++++++++++++++++++-------------------- views/projet.xml | 23 ++++++++++++----------- wizards/moa.py | 2 +- wizards/moe.py | 2 +- 5 files changed, 41 insertions(+), 35 deletions(-) diff --git a/demo/projet.xml b/demo/projet.xml index a1da023..b9d1752 100644 --- a/demo/projet.xml +++ b/demo/projet.xml @@ -25,9 +25,9 @@ Projet of the doom - Ici c'est la description de ce super projet ! + Ici c'est la description de ce super projet ! 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" diff --git a/views/projet.xml b/views/projet.xml index 40d263e..3d150aa 100644 --- a/views/projet.xml +++ b/views/projet.xml @@ -14,32 +14,33 @@ - +

MOE