diff --git a/lefilament_projets.py b/lefilament_projets.py index 1a901bcc7155f9f35d4f59a8d0edf8ac1f1b6a68..654182ca27ac77d312d5699b2d0875d95ff940da 100644 --- a/lefilament_projets.py +++ b/lefilament_projets.py @@ -12,9 +12,10 @@ class SapovalPartners(models.Model): lf_total_budget = fields.Float('Budget Projet',) lf_tarif_jour = fields.Float('Tarif Jour',) lf_taux_horaire = fields.Float('Taux Horaire', compute='_taux_horaire') - lf_heures_projet = fields.Float('Heures allouées', compute='_total_heures') + lf_heures_projet = fields.Float('Allouées (h)', compute='_total_heures') lf_heures_passees = fields.Float('Heures passées', compute='_total_heures_passees') - lf_heures_restantes = fields.Float('Heures restantes', compute='_total_heures_restantes') + lf_heures_restantes = fields.Float('Restant (h)', compute='_total_heures_restantes') + lf_heures_planifiees = fields.Float('Planifiées (h)', compute='_total_heures_planifiees') @api.one def _taux_horaire(self): @@ -36,4 +37,11 @@ class SapovalPartners(models.Model): @api.one def _total_heures_restantes(self): - self.lf_heures_restantes = self.lf_heures_projet - self.lf_heures_passees \ No newline at end of file + self.lf_heures_restantes = self.lf_heures_projet - self.lf_heures_passees + + @api.one + def _total_heures_planifiees(self): + res = 0.0 + for record in self.task_ids: + res = res + record.planned_hours + self.lf_heures_planifiees = res \ No newline at end of file diff --git a/lefilament_projets.pyc b/lefilament_projets.pyc index 7a7a034ff5055afa59d78dea153e937323f4b721..ec7b34830ecf4f7e24cfe6c07f3b8b25422266c2 100644 Binary files a/lefilament_projets.pyc and b/lefilament_projets.pyc differ diff --git a/views/lefilament_projets_view.xml b/views/lefilament_projets_view.xml index 8139818a6ca8b6e9b50196808cb5198d2a313553..c036718d9ba0a7aeba1a92d5a827da2847ce753f 100644 --- a/views/lefilament_projets_view.xml +++ b/views/lefilament_projets_view.xml @@ -34,8 +34,10 @@ <field eval="0" name="sequence"/> <field name="arch" type="xml"> <xpath expr="//field[@name='state']" position="after"> - <field name="lf_heures_projet" /> <field name="lf_total_budget" /> + <field name="lf_heures_projet" /> + <field name="lf_heures_planifiees" /> + <field name="lf_heures_restantes" /> </xpath> </field> </record> @@ -48,17 +50,29 @@ <field name="arch" type="xml"> <xpath expr="//div[@class='o_kanban_primary_left']" position="after"> <field name="lf_total_budget"> euros</field> + <table class="table table-condensed" style="margin-bottom: 0;"> + <thead style="background: transparent; border-bottom: 1px solid #555;"> + <tr> + <td style="padding: 5px 0;">potentiel</td> + <td style="padding: 5px 0;">plannifié</td> + </tr> + </thead> + <tbody> + <tr> + <td style="padding: 5px 0;border-top: 1px solid #555;"><field name="lf_heures_projet" >h</field></td> + <td style="padding: 5px 0;border-top: 1px solid #555;"><field name="lf_heures_planifiees" >h</field></td> + </tr> + </tbody> + </table> <table class="table table-condensed"> <thead style="background: transparent; border-bottom: 1px solid #555;"> <tr> - <td style="padding: 5px 0;">prévu</td> - <td style="padding: 5px 0;">cours</td> + <td style="padding: 5px 0;">en cours</td> <td style="padding: 5px 0;">reste</td> </tr> </thead> <tbody> <tr> - <td style="padding: 5px 0;border-top: 1px solid #555;"><field name="lf_heures_projet" >h</field></td> <td style="padding: 5px 0;border-top: 1px solid #555;"><field name="lf_heures_passees" >h</field></td> <td style="padding: 5px 0;border-top: 1px solid #555;"><field name="lf_heures_restantes" >h</field></td> </tr>