Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
L
lefilament_projets
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Le Filament
lefilament_projets
Validations
5e2d02d2
Valider
5e2d02d2
rédigé
13 nov. 2017
par
Rémi - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Add monitoring of prospection hours
parent
ab4b2d4f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
models/project.py
+14
-0
14 ajouts, 0 suppression
models/project.py
views/lefilament_projets_view.xml
+14
-2
14 ajouts, 2 suppressions
views/lefilament_projets_view.xml
avec
28 ajouts
et
2 suppressions
models/project.py
+
14
−
0
Voir le fichier @
5e2d02d2
...
...
@@ -11,10 +11,12 @@ from odoo import models, fields, api, osv
class
FilamentProjet
(
models
.
Model
):
_inherit
=
'
project.project
'
use_prospection
=
fields
.
Boolean
(
"
Inclure Prospection
"
,
default
=
False
)
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_taux_horaire
=
fields
.
Float
(
'
Taux Horaire
'
,
compute
=
'
_taux_horaire
'
)
lf_heures_prospection
=
fields
.
Float
(
'
Prospection (h)
'
,
compute
=
'
_total_heures_prospection
'
)
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
(
'
Restant (h)
'
,
compute
=
'
_total_heures_restantes
'
)
...
...
@@ -36,6 +38,18 @@ class FilamentProjet(models.Model):
lf_heures_jour
=
self
.
env
[
'
ir.values
'
].
get_default
(
'
project.config.settings
'
,
'
lf_heures_jour
'
)
self
.
lf_taux_horaire
=
self
.
lf_tarif_jour
/
lf_heures_jour
@api.one
def
_total_heures_prospection
(
self
):
res
=
0.0
project
=
self
.
id
## Calcul heures
self
.
env
.
cr
.
execute
(
"
select sum(aal.unit_amount) from account_analytic_line aal, project_task pt where aal.project_id=%s and pt.name=
'
Prospection
'
and pt.id=aal.task_id;
"
,
(
project
,
)
)
heures_prospection
=
self
.
env
.
cr
.
fetchone
()[
0
]
if
heures_prospection
:
self
.
lf_heures_prospection
=
heures_prospection
else
:
self
.
lf_heures_prospection
=
0.0
@api.one
def
_total_heures_passees
(
self
):
res
=
0.0
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
views/lefilament_projets_view.xml
+
14
−
2
Voir le fichier @
5e2d02d2
...
...
@@ -14,6 +14,12 @@
<button
string=
"Voir le Cash Flow"
type=
"object"
name=
"open_cash_flow"
class=
"oe_highlight"
/>
</header>
</xpath>
<xpath
expr=
"//field[@name='use_tasks']"
position=
"before"
>
<div>
<field
name=
"use_prospection"
class=
"oe_inline"
/>
<label
for=
"use_prospection"
class=
"oe_inline"
/>
</div>
</xpath>
<xpath
expr=
"//notebook"
position=
"before"
>
<group>
<group>
...
...
@@ -60,6 +66,7 @@
<field
name=
"arch"
type=
"xml"
>
<xpath
expr=
"//field[@name='partner_id']"
position=
"after"
>
<field
name=
"lf_total_budget"
/>
<field
name=
"lf_heures_prospection"
/>
<field
name=
"lf_heures_budget"
/>
<field
name=
"lf_heures_projet"
/>
<field
name=
"lf_heures_planifiees"
/>
...
...
@@ -76,10 +83,14 @@
<field
name=
"model"
>
project.project
</field>
<field
name=
"inherit_id"
ref=
"project.view_project_kanban"
/>
<field
name=
"arch"
type=
"xml"
>
<xpath
expr=
"//templates"
position=
"before"
>
<field
name=
"use_prospection"
/>
</xpath>
<xpath
expr=
"//div[@class='o_kanban_primary_left']"
position=
"after"
>
<table
class=
"table table-condensed"
style=
"margin-bottom: 0;"
>
<thead
style=
"background: transparent; border-bottom: 1px solid #555;"
>
<tr>
<td
attrs=
"{'invisible':[('use_prospection', '=', False)]}"
>
prospection
</td>
<td>
vendues
</td>
<td>
passées
</td>
<td>
restantes
</td>
...
...
@@ -87,6 +98,7 @@
</thead>
<tbody>
<tr>
<td
class=
"lf_cell"
attrs=
"{'invisible': [('use_prospection', '=', False)]}"
><field
name=
"lf_heures_prospection"
>
h
</field></td>
<td
class=
"lf_cell"
><field
name=
"lf_heures_projet"
>
h
</field></td>
<td
class=
"lf_cell"
><field
name=
"lf_heures_passees"
>
h
</field></td>
<td
class=
"lf_cell"
><field
name=
"lf_heures_restantes"
>
h
</field></td>
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter