Correction apportée au wizard Projet/MOA
authorAlicia FLOREZ <alicflorez@gmail.com>
Thu, 23 May 2013 10:09:45 +0000 (12:09 +0200)
committerAlicia FLOREZ <alicflorez@gmail.com>
Thu, 23 May 2013 10:09:45 +0000 (12:09 +0200)
projet.py

index 8758a83..dd108b2 100644 (file)
--- a/projet.py
+++ b/projet.py
@@ -135,4 +135,26 @@ class ProjetMoe(osv.Model):
                                       string="Projet"),
         "moe_id": fields.many2one("cmmi.mo.moe",
                                       string="MOE"),
+    }
+
+
+class ProjetMoa(osv.Model):
+    _name = "cmmi.projet.moe"
+
+    def _get_name(self, cr, uid, ids, field_name=None, arg=None, context=None):
+        if isinstance(ids, (int, long)):
+            ids = [ids]
+        return dict([(i, r.domaine_id.name) for i, r in
+                zip(ids, self.browse(cr, uid, ids, context=context))])
+
+    _columns = {
+        "name": fields.function(_get_name,
+                                type='char',
+                                store=True,
+                                string="Nom de la MOA"),
+        "main": fields.boolean(string="MOA principale ?"),
+        "project_id": fields.many2one("cmmi.projet",
+                                      string="Projet"),
+        "moa_id": fields.many2one("cmmi.mo.moa",
+                                      string="MOA"),
     }
\ No newline at end of file