From: Alicia FLOREZ Date: Fri, 31 May 2013 10:22:09 +0000 (+0200) Subject: Ajout d'un champ dans projet, permettant de récupérer les phases sélectionnées X-Git-Url: http://git.inspyration.org/?p=OpenERP%2Fcmmi.git;a=commitdiff_plain;h=289fd756682d0be824e1841e44b027e376d6b61b Ajout d'un champ dans projet, permettant de récupérer les phases sélectionnées --- diff --git a/projet.py b/projet.py index 1b86edf..90a40d6 100644 --- a/projet.py +++ b/projet.py @@ -64,7 +64,18 @@ class Projet(osv.Model): break else: result[project.id] = "Any MOE is selected as main MOE yet" + return result + + def _get_phases_selectionnees(self, cr, uid, ids, field_name=None, arg=None, context=None): + result = {} + for projet in self.browse(cr, uid, ids, context=context): + res = [] + for phase in projet.phases: + #import pdb; pdb.set_trace() + if phase.selectionne: + res.append(phase.id) + result[projet.id] = res return result @@ -111,6 +122,10 @@ class Projet(osv.Model): "main_domain": fields.function(_get_main_domain, type="string", string="Domaine principal"), + "phases_selectionnees": fields.function(_get_phases_selectionnees, + type="one2many", + obj="cmmi.projet.phase", + string="Phases sélectionnées"), } diff --git a/views/projet.xml b/views/projet.xml index babaaef..0f06d54 100644 --- a/views/projet.xml +++ b/views/projet.xml @@ -117,6 +117,9 @@ + + + diff --git a/wizards/domaine.py b/wizards/domaine.py index ba926b4..510150c 100644 --- a/wizards/domaine.py +++ b/wizards/domaine.py @@ -103,7 +103,7 @@ class ProjetDomaineWizard(osv.TransientModel): # Fermer simplement la fenêtre return {'type': 'ir.actions.act_window_close'} - #----------------------------------------------------------------------- + #====================================================================== # # Renvoi vers la vue du modèle # return { # "type": 'ir.actions.act_window', @@ -114,7 +114,7 @@ class ProjetDomaineWizard(osv.TransientModel): # #'target': 'new', = pop-up # 'context': context, # } - #----------------------------------------------------------------------- + #====================================================================== _columns = { "main": fields.boolean(string="Domaine principal ?"),