Rajout de l'explosion des fichiers
[OpenERP/cmmi.git] / projet.py
index 39b2327..8758a83 100644 (file)
--- a/projet.py
+++ b/projet.py
@@ -113,3 +113,26 @@ class ProjetDomaine(osv.Model):
         self.write(cr, uid, current_id, {'main': True}, context=context)
 
         return {'value': {'main': True}}
+
+
+
+class ProjetMoe(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 MOE"),
+        "main": fields.boolean(string="MOE principale ?"),
+        "project_id": fields.many2one("cmmi.projet",
+                                      string="Projet"),
+        "moe_id": fields.many2one("cmmi.mo.moe",
+                                      string="MOE"),
+    }
\ No newline at end of file