Wizard pour l'ajout de phase à un palier, à finir
authorAlicia FLOREZ <alicflorez@gmail.com>
Fri, 31 May 2013 14:34:06 +0000 (16:34 +0200)
committerAlicia FLOREZ <alicflorez@gmail.com>
Fri, 31 May 2013 14:34:06 +0000 (16:34 +0200)
views/wizards/chantier.xml [new file with mode: 0644]
wizards/chantier.py [new file with mode: 0644]
wizards/palierPhase.py [new file with mode: 0644]

diff --git a/views/wizards/chantier.xml b/views/wizards/chantier.xml
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/wizards/chantier.py b/wizards/chantier.py
new file mode 100644 (file)
index 0000000..006d389
--- /dev/null
@@ -0,0 +1,7 @@
+#-*- coding: utf8 -*-
+
+from openerp.osv import osv, fields
+
+class ProjetChantierWizard(osv.TransientModel):
+
+    _name = "cmmi.projet.chantier.wizard"
\ No newline at end of file
diff --git a/wizards/palierPhase.py b/wizards/palierPhase.py
new file mode 100644 (file)
index 0000000..8716880
--- /dev/null
@@ -0,0 +1,40 @@
+#-*- coding: utf8 -*-
+
+from openerp.osv import osv, fields
+
+# TODO: finir PalierPhaseWizard
+class PalierPhaseWizard(osv.TransientModel):
+
+    _name = "cmmi.palier.phase.wizard"
+
+
+    def default_get(self, cr, uid, fields, context=None):
+        result = osv.TransientModel.default_get(self, cr, uid, fields, context=context)
+        palier_id = context.get('palier_id', False)
+        if palier_id:
+            result['palier_id'] = palier_id
+        return result
+
+
+
+    def _phases_selection(self, cr, uid, context=None):
+        phase_model = self.pool.get("cmmi.phase")
+        palier_phase_model = self.pool.get("cmmi.axes.palier.phase")
+
+        if context is None or not context.has_key("palier_id"):
+            return []
+
+
+
+    _columns = {
+        "palier_id": fields.many2one("cmmi.axes.palier",
+                                     string="Palier",
+                                     required=True),
+#        "phase_id": fields.selection("cmmi.projet.phase",
+#                                     string="Phase",
+#                                     required=True,
+#                                     domain=[("selectionne", "=", True)]),
+        "phase_id": fields.function(_phases_selection,
+                                    string="Phase",
+                                    required=True),
+    }
\ No newline at end of file