From d5fcaa6b1e469fc0459f8aaf0131b4f4623cc2c9 Mon Sep 17 00:00:00 2001 From: Alicia FLOREZ Date: Tue, 4 Jun 2013 16:59:54 +0200 Subject: [PATCH] =?utf8?q?Ajout=20d'un=20warning=20pour=20la=20fonction=20'c?= =?utf8?q?ommencer'=20de=20Mesurable,=20=C3=A0=20fixer?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- axes.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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" -- 1.7.10.4