Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
C
cgscop_timesheet
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
Hervé Silvant - CGScop
cgscop_timesheet
Validations
869c3ec7
Valider
869c3ec7
rédigé
Il y a 1 an
par
Hervé Silvant - CGScop
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Ajout d'un total par activité sur l'impression de la feuille de temps
parent
0c0f7a76
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/cgscop_timesheet_sheet.py
+51
-0
51 ajouts, 0 suppression
models/cgscop_timesheet_sheet.py
report/report_hr_timesheet_act.xml
+18
-12
18 ajouts, 12 suppressions
report/report_hr_timesheet_act.xml
avec
69 ajouts
et
12 suppressions
models/cgscop_timesheet_sheet.py
+
51
−
0
Voir le fichier @
869c3ec7
...
...
@@ -123,3 +123,54 @@ class ScopHrTimesheetSheet(models.Model):
return
self
.
env
.
ref
(
"
cgscop_timesheet.cgscop_timesheet_sheet_report
"
).
report_action
(
self
)
# ------------------------------------------------------
# Retourne les lignes de la Fdt avec les totaux par projet
# ------------------------------------------------------
def
_to_duration
(
self
,
infloat
):
return
'
{0:02.0f}:{1:02.0f}
'
.
format
(
*
divmod
(
infloat
*
60
,
60
))
def
_get_timesheet_line_act
(
self
):
for
sheet
in
self
:
lines
=
sheet
.
timesheet_line_ids
.
sorted
(
key
=
lambda
b
:
(
b
.
project_id
.
name
,
b
.
date
))
rows
=
[]
last_project
=
False
tot_project
=
0
for
line
in
lines
:
# On insère un total intermédiaire
if
last_project
!=
line
.
project_id
.
name
and
tot_project
!=
0
:
rows
.
append
({
'
total
'
:
1
,
'
name
'
:
False
,
'
partner
'
:
False
,
'
project
'
:
False
,
'
date
'
:
False
,
'
ur_financial_system
'
:
'
Total
'
+
last_project
+
'
:
'
+
self
.
_to_duration
(
tot_project
),
'
unit_amount
'
:
False
,
})
tot_project
=
0
# On insère la ligne lue
rows
.
append
({
'
total
'
:
0
,
'
name
'
:
line
.
name
,
'
partner
'
:
line
.
partner_id
.
name
,
'
project
'
:
line
.
project_id
.
name
,
'
date
'
:
line
.
date
,
'
ur_financial_system
'
:
line
.
ur_financial_system_id
.
name
,
'
unit_amount
'
:
self
.
_to_duration
(
line
.
unit_amount
),
})
last_project
=
line
.
project_id
.
name
tot_project
=
tot_project
+
line
.
unit_amount
# On insère le dernier total
rows
.
append
({
'
total
'
:
1
,
'
name
'
:
False
,
'
partner
'
:
False
,
'
project
'
:
False
,
'
date
'
:
False
,
'
ur_financial_system
'
:
'
Total
'
+
last_project
+
'
:
'
+
self
.
_to_duration
(
tot_project
),
'
unit_amount
'
:
False
,
})
return
rows
Ce diff est replié.
Cliquez pour l'agrandir.
report/report_hr_timesheet_act.xml
+
18
−
12
Voir le fichier @
869c3ec7
...
...
@@ -51,21 +51,27 @@
</thead>
<tbody
class=
"invoice_tbody"
>
<t
t-foreach=
"o.timesheet_line_
ids.sorted(key=lambda b: (b.project_id.name,b.date)
)"
t-foreach=
"o.
_get_
timesheet_line_
act(
)"
t-as=
"line"
>
<tr>
<td><span
t-field=
"line.project_id"
/></td>
<td><span
t-field=
"line.date"
/></td>
<td><span
t-field=
"line.partner_id"
/></td>
<td><span
t-field=
"line.name"
/></td>
<td><span
t-field=
"line.ur_financial_system_id"
/></td>
<td
class=
"text-right"
><span
t-field=
"line.unit_amount"
t-options=
"{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}"
/></td>
<td><span><t
t-esc=
"line['project']"
/></span></td>
<td><span><t
t-esc=
"line['date']"
/></span></td>
<td><span><t
t-esc=
"line['partner']"
/></span></td>
<td><span><t
t-esc=
"line['name']"
/></span></td>
<td><span>
<t
t-if=
"line['total']==1"
>
<strong>
<t
t-esc=
"line['ur_financial_system']"
/>
</strong>
</t>
<t
t-if=
"line['total']==0"
>
<t
t-esc=
"line['ur_financial_system']"
/>
</t>
</span></td>
<td
class=
"text-right"
><span>
<t
t-esc=
"line['unit_amount']"
/>
</span></td>
</tr>
</t>
<tr>
...
...
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