Skip to content
Extraits de code Groupes Projets
Valider 5abaef14 rédigé par Benjamin's avatar Benjamin
Parcourir les fichiers

[modif] journée = 8h

parent ca9c9efe
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -10,6 +10,7 @@ class SapovalPartners(models.Model): ...@@ -10,6 +10,7 @@ class SapovalPartners(models.Model):
_inherit = 'project.project' _inherit = 'project.project'
lf_total_budget = fields.Float('Budget Projet',) lf_total_budget = fields.Float('Budget Projet',)
lf_heures_budget = fields.Float('Budget Heures', compute='_budget_heures')
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('Allouées (h)', compute='_total_heures') lf_heures_projet = fields.Float('Allouées (h)', compute='_total_heures')
...@@ -20,14 +21,7 @@ class SapovalPartners(models.Model): ...@@ -20,14 +21,7 @@ class SapovalPartners(models.Model):
@api.one @api.one
def _taux_horaire(self): def _taux_horaire(self):
self.lf_taux_horaire = self.lf_tarif_jour / 7.5 self.lf_taux_horaire = self.lf_tarif_jour / 8
@api.one
def _total_heures(self):
if (self.lf_tarif_jour != 0.0):
self.lf_heures_projet = (self.lf_total_budget / self.lf_tarif_jour) * 7.5
else:
self.lf_heures_projet = 0.0
@api.one @api.one
def _total_heures_passees(self): def _total_heures_passees(self):
...@@ -36,10 +30,6 @@ class SapovalPartners(models.Model): ...@@ -36,10 +30,6 @@ class SapovalPartners(models.Model):
res = res + record.effective_hours res = res + record.effective_hours
self.lf_heures_passees = res self.lf_heures_passees = res
@api.one
def _total_heures_restantes(self):
self.lf_heures_restantes = self.lf_heures_projet - self.lf_heures_passees
@api.one @api.one
def _total_heures_planifiees(self): def _total_heures_planifiees(self):
res = 0.0 res = 0.0
...@@ -58,3 +48,28 @@ class SapovalPartners(models.Model): ...@@ -58,3 +48,28 @@ class SapovalPartners(models.Model):
else: else:
self.lf_couts_annexes = 0.0 self.lf_couts_annexes = 0.0
@api.one
@api.depends('lf_total_budget','lf_couts_annexes')
def _budget_heures(self):
self.lf_heures_budget = self.lf_total_budget - self.lf_couts_annexes
@api.one
def _total_heures(self):
if (self.lf_tarif_jour != 0.0):
self.lf_heures_projet = (self.lf_heures_budget / self.lf_tarif_jour) * 7.5
else:
self.lf_heures_projet = 0.0
@api.one
def _total_heures_restantes(self):
self.lf_heures_restantes = self.lf_heures_projet - self.lf_heures_passees
def open_project(self):
return {
'type': 'ir.actions.act_window',
'name': 'Projet' + self.name,
'view_mode': 'kanban',
'res_model': 'project.project',
'res_id': self.id,
'views': [(False, 'kanban')],
}
Fichier supprimé
.o_project_kanban_main { width: 100%!important; } .o_project_kanban_main { width: 100%!important; }
.o_project_kanban_main a { color: inherit!important; }
.lf_cell { padding: 5px 0; border-top: 1px solid #999!important; } .lf_cell { padding: 5px 0; border-top: 1px solid #999!important; }
.budget_table { margin-top: 10px; margin-bottom: 20px; } .budget_table { margin-top: 10px; margin-bottom: 20px; }
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
<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_total_budget" /> <field name="lf_total_budget" />
<field name="lf_heures_budget" />
<field name="lf_heures_projet" /> <field name="lf_heures_projet" />
<field name="lf_heures_planifiees" /> <field name="lf_heures_planifiees" />
<field name="lf_heures_restantes" /> <field name="lf_heures_restantes" />
...@@ -57,7 +58,6 @@ ...@@ -57,7 +58,6 @@
<field name="inherit_id" ref="project.view_project_kanban"/> <field name="inherit_id" ref="project.view_project_kanban"/>
<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">
<a t-if="record.use_tasks.raw_value" name="%(project.act_project_project_2_project_task_all)d" type="action">
<table class="table table-condensed" style="margin-bottom: 0;"> <table class="table table-condensed" style="margin-bottom: 0;">
<thead style="background: transparent; border-bottom: 1px solid #555;"> <thead style="background: transparent; border-bottom: 1px solid #555;">
<tr> <tr>
...@@ -75,14 +75,21 @@ ...@@ -75,14 +75,21 @@
</tbody> </tbody>
</table> </table>
<table class="budget_table"><tbody><tr> <table class="budget_table"><tbody><tr>
<td><strong>Budget : </strong></td> <td><strong>Budget total : </strong></td>
<td><field name="lf_total_budget"></field></td> <td><field name="lf_total_budget"></field></td>
</tr> </tr>
<tr> <tr>
<td><strong>Coûts Annexes : </strong></td> <td><strong>Coûts Annexes : </strong></td>
<td><field name="lf_couts_annexes"></field></td> <td><field name="lf_couts_annexes"></field></td>
</tr>
<tr>
<td><strong>Budget heures : </strong></td>
<td><field name="lf_heures_budget"></field></td>
</tr></tbody></table>
<table class="budget_table"><tbody><tr>
<td><a t-if="record.use_tasks.raw_value" name="%(project.act_project_project_2_project_task_all)d" type="action">Voir les tâches</a></td>
<!-- <td><a name="%(act_detail_project)d" type="action">Voir détail projet</a></td> -->
</tr></tbody></table> </tr></tbody></table>
</a>
</xpath> </xpath>
<!-- HIDE TASK AND DOCS NUMBER --> <!-- HIDE TASK AND DOCS NUMBER -->
<xpath expr="//div[@class='o_project_kanban_boxes']" position="attributes"> <xpath expr="//div[@class='o_project_kanban_boxes']" position="attributes">
...@@ -91,7 +98,5 @@ ...@@ -91,7 +98,5 @@
</field> </field>
</record> </record>
</data> </data>
</openerp> </openerp>
\ No newline at end of file
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