From 2a083da23e74be5ac98cf7d5c8c3d743249515da Mon Sep 17 00:00:00 2001 From: Alicia FLOREZ Date: Thu, 13 Jun 2013 11:22:37 +0200 Subject: [PATCH] =?utf8?q?Ajout=20=C3=A0=20la=20classe=20cmmi.evolution.phas?= =?utf8?q?e=20une=20m=C3=A9thode=20commencer?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- evolution.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/evolution.py b/evolution.py index f1d7fa7..8db0df3 100644 --- a/evolution.py +++ b/evolution.py @@ -198,6 +198,23 @@ class Phase(osv.Model): return osv.Model.create(self, cr, uid, vals, context=context) + def commencer(self, cr, uid, ids, context=None): + if type(ids) == list: + if len(ids) != 1: + return + ids = ids[0] + + phase = self.read(cr, uid, ids, ['charge_plan'], context) + + self.write( + cr, + uid, + ids, { + 'charge_init' : phase['charge_plan'], + }, + context) + return self + # =========================== EVOLUTION CHARGE ============================== # class Charge(osv.Model): -- 1.7.10.4