Évolution : ajout d'un champ calculé pour les charges plan
authorAlicia FLOREZ <alicflorez@gmail.com>
Thu, 13 Jun 2013 09:50:47 +0000 (11:50 +0200)
committerAlicia FLOREZ <alicflorez@gmail.com>
Thu, 13 Jun 2013 09:50:47 +0000 (11:50 +0200)
evolution.py

index 05426ed..485ef59 100644 (file)
@@ -31,6 +31,13 @@ class Evolution(osv.Model):
         return result
 
 
+    def _get_charge_plan(self, cr, uid, ids, field, arg, context=None):
+        result = {}
+        for evo in self.browse(cr, uid, context=context):
+            result[evo.id] = sum([p.charge_plan for p in evo.phases])
+        return result
+
+
     _columns = {
         "pid": fields.integer(string="PID"),
         "name": fields.char(string="Title", size=64, required=True),