diff --git a/lefilament_projets.py b/lefilament_projets.py index f57e2d495da4b36b5c1727aae0581237d3f12234..ae4c562ca3aa2d9b2b586b23ffd926e110d4d88b 100644 --- a/lefilament_projets.py +++ b/lefilament_projets.py @@ -18,6 +18,8 @@ class SapovalPartners(models.Model): lf_heures_restantes = fields.Float('Restant (h)', compute='_total_heures_restantes') lf_heures_planifiees = fields.Float('Planifiées (h)', compute='_total_heures_planifiees') lf_couts_annexes = fields.Float('Coûts Annexes', compute='_couts_annexes') + lf_couts_estimes = fields.Float('Coûts Estimes') + lf_commentaire = fields.Text('Commentaires') @api.one def _taux_horaire(self): @@ -57,7 +59,7 @@ class SapovalPartners(models.Model): @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 + self.lf_heures_budget = self.lf_total_budget - self.lf_couts_estimes @api.one def _total_heures(self): diff --git a/static/src/less/style.less b/static/src/less/style.less index a91c85affc7b922bcb07fe35ac7d7fbfeaf5a0b1..00aa50fd98af80ee8cfda2149f45a4302c936d0b 100644 --- a/static/src/less/style.less +++ b/static/src/less/style.less @@ -3,4 +3,12 @@ .lf_cell { padding: 5px 0; border-top: 1px solid #999!important; } .budget_table { margin-top: 10px; margin-bottom: 20px; } -.budget_table td { padding: 0 5px; } \ No newline at end of file +.budget_table td { padding: 0 5px; } + +.project-progress .o_progressbar .o_progress { + border-radius: 0; + border: 1px solid #f0f0f0; +} +.project-progress .o_progressbar .o_progress .o_progressbar_complete { + background-color: #26a69a; +} \ No newline at end of file diff --git a/views/lefilament_projets_view.xml b/views/lefilament_projets_view.xml index 2a7190245753f0023c27aaff73ce65991df291ea..e8ba2bbbf83cb73879917dba61f74babca03a420 100644 --- a/views/lefilament_projets_view.xml +++ b/views/lefilament_projets_view.xml @@ -21,6 +21,7 @@ <group> <field name="lf_total_budget" widget="monetary" options="{'currency_field': 'company_currency'}"/> <field name="lf_tarif_jour" widget="monetary" options="{'currency_field': 'company_currency'}"/> + <field name="lf_couts_estimes" widget="monetary" options="{'currency_field': 'company_currency'}"/> </group> <group> <field name="lf_taux_horaire" widget="monetary" options="{'currency_field': 'company_currency'}"/> @@ -28,6 +29,11 @@ </group> </group> </xpath> + <xpath expr="//page" position="before"> + <page string="Commentaires" name="commentaires"> + <field name="lf_commentaire" /> + </page> + </xpath> </field> </record> @@ -47,6 +53,7 @@ <field name="lf_heures_planifiees" /> <field name="lf_heures_restantes" /> <field name="lf_couts_annexes" /> + <field name="lf_couts_estimes" /> </xpath> </field> </record> @@ -74,21 +81,29 @@ </tr> </tbody> </table> + <div class="project-progress"> + <field name="lf_heures_restantes" widget="progress" options="{'current_value': 'lf_heures_restantes', 'max_value': 'lf_heures_projet', 'editable': false, 'edit_max_value': false, }" /> + </div> <table class="budget_table"><tbody><tr> - <td><strong>Budget total : </strong></td> + <td>Budget total : </td> <td><field name="lf_total_budget"> €</field></td> </tr> <tr> - <td><strong>Coûts Annexes : </strong></td> - <td><field name="lf_couts_annexes"> €</field></td> + <td>Budget heures : </td> + <td><field name="lf_heures_budget"> €</field></td> </tr> <tr> - <td><strong>Budget heures : </strong></td> - <td><field name="lf_heures_budget"> €</field></td> - </tr></tbody></table> + <td>Coûts estimés : </td> + <td><field name="lf_couts_estimes"> €</field></td> + </tr> + <tr> + <td>Coûts annexes : </td> + <td><field name="lf_couts_annexes"> €</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 type="edit">Editer le projet</a></td> </tr></tbody></table> </xpath> <!-- HIDE TASK AND DOCS NUMBER -->