Skip to content
Extraits de code Groupes Projets
Valider bee4819f rédigé par Benj's avatar Benj
Parcourir les fichiers

ajout heures planifiées

parent 3897f366
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -12,9 +12,10 @@ class SapovalPartners(models.Model): ...@@ -12,9 +12,10 @@ class SapovalPartners(models.Model):
lf_total_budget = fields.Float('Budget Projet',) lf_total_budget = fields.Float('Budget Projet',)
lf_tarif_jour = fields.Float('Tarif Jour',) lf_tarif_jour = fields.Float('Tarif Jour',)
lf_taux_horaire = fields.Float('Taux Horaire', compute='_taux_horaire') 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_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 @api.one
def _taux_horaire(self): def _taux_horaire(self):
...@@ -37,3 +38,10 @@ class SapovalPartners(models.Model): ...@@ -37,3 +38,10 @@ class SapovalPartners(models.Model):
@api.one @api.one
def _total_heures_restantes(self): def _total_heures_restantes(self):
self.lf_heures_restantes = self.lf_heures_projet - self.lf_heures_passees 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
Aucun aperçu pour ce type de fichier
...@@ -34,8 +34,10 @@ ...@@ -34,8 +34,10 @@
<field eval="0" name="sequence"/> <field eval="0" name="sequence"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='state']" position="after"> <xpath expr="//field[@name='state']" position="after">
<field name="lf_heures_projet" />
<field name="lf_total_budget" /> <field name="lf_total_budget" />
<field name="lf_heures_projet" />
<field name="lf_heures_planifiees" />
<field name="lf_heures_restantes" />
</xpath> </xpath>
</field> </field>
</record> </record>
...@@ -48,17 +50,29 @@ ...@@ -48,17 +50,29 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@class='o_kanban_primary_left']" position="after"> <xpath expr="//div[@class='o_kanban_primary_left']" position="after">
<field name="lf_total_budget"> euros</field> <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"> <table class="table table-condensed">
<thead style="background: transparent; border-bottom: 1px solid #555;"> <thead style="background: transparent; border-bottom: 1px solid #555;">
<tr> <tr>
<td style="padding: 5px 0;">prévu</td> <td style="padding: 5px 0;">en cours</td>
<td style="padding: 5px 0;">cours</td>
<td style="padding: 5px 0;">reste</td> <td style="padding: 5px 0;">reste</td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <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_passees" >h</field></td>
<td style="padding: 5px 0;border-top: 1px solid #555;"><field name="lf_heures_restantes" >h</field></td> <td style="padding: 5px 0;border-top: 1px solid #555;"><field name="lf_heures_restantes" >h</field></td>
</tr> </tr>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter