From: Alicia FLOREZ Date: Tue, 4 Jun 2013 14:59:54 +0000 (+0200) Subject: Ajout d'un warning pour la fonction 'commencer' de Mesurable, à fixer X-Git-Url: http://git.inspyration.org/?p=OpenERP%2Fcmmi.git;a=commitdiff_plain;h=d5fcaa6b1e469fc0459f8aaf0131b4f4623cc2c9 Ajout d'un warning pour la fonction 'commencer' de Mesurable, à fixer --- diff --git a/axes.py b/axes.py index 522dfab..6c73ba9 100644 --- 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"