From: Alicia FLOREZ Date: Thu, 13 Jun 2013 15:47:33 +0000 (+0200) Subject: Ajout d'un champ fonction charge réel à palier_phase X-Git-Url: http://git.inspyration.org/?p=OpenERP%2Fcmmi.git;a=commitdiff_plain;h=97ea337194fea3ab077efc1e2136d159e92b648e Ajout d'un champ fonction charge réel à palier_phase --- diff --git a/axes.py b/axes.py index 23437c1..aa2e4ac 100644 --- a/axes.py +++ b/axes.py @@ -371,6 +371,12 @@ class PalierPhase(osv.Model): result[pp.id] = sum([p.charge_plan for p in pp.phases]) return result + def _get_charge_reel(self, cr, uid, ids, field, arg, context=None): + result = {} + for pp in self.browse(cr, uid, ids, context=context): + result[pp.id] = sum([c.quantite for c in pp.charges]) + return result + _columns = { "name": fields.function(_get_name, @@ -387,6 +393,9 @@ class PalierPhase(osv.Model): "charge_plan": fields.function(_get_charge_plan, type="integer", string="Charge plannifiée"), + "charge_reel": fields.function(_get_charge_reel, + type="integer", + string="Charge plannifiée"), # backrefs "charges": fields.one2many("cmmi.evolution.charge", "phase_id",