Ajout d'un warning pour la fonction 'commencer' de Mesurable, à fixer
authorAlicia FLOREZ <alicflorez@gmail.com>
Tue, 4 Jun 2013 14:59:54 +0000 (16:59 +0200)
committerAlicia FLOREZ <alicflorez@gmail.com>
Tue, 4 Jun 2013 14:59:54 +0000 (16:59 +0200)
axes.py

diff --git a/axes.py b/axes.py
index 522dfab..6c73ba9 100644 (file)
--- a/axes.py
+++ b/axes.py
@@ -70,13 +70,18 @@ class Mesurable(osv.Model):
     def commencer(self, cr, uid, ids, context=None):
         if type(ids) == list:
             if len(ids) != 1:
-                return # TODO: message d'avertissement
+                return
             ids = ids[0]
 
         palier = self.read(cr, uid, ids, ['date_plan_deb', 'date_plan_fin', 'state'], context)
 
         if palier['state'] != 'cree':
-            return
+            return {
+                    'warning': { # FIXME: ne fonctionne pas
+                        'title'   : "Warning: not a list",
+                        'message' : "You cannot have negative number of seats",
+                        },
+                    }
 
         self.write(
             cr,
@@ -334,7 +339,6 @@ class PalierPhase(osv.Model):
         return osv.Model.create(self, cr, uid, vals, context=context)
 
 
-
 # ================================ CHANTIER ================================= #
 class Chantier(osv.Model):
     _name = "cmmi.axes.chantier"