From bee4819fb3c3c62e8f608ddc1b29a15c3b5b15ff Mon Sep 17 00:00:00 2001
From: Benj <benj@MacBook-Pro-de-Benj.local>
Date: Wed, 19 Oct 2016 08:55:44 +0200
Subject: [PATCH] =?UTF-8?q?ajout=20heures=20planifi=C3=A9es?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lefilament_projets.py             |  14 +++++++++++---
 lefilament_projets.pyc            | Bin 1848 -> 2514 bytes
 views/lefilament_projets_view.xml |  22 ++++++++++++++++++----
 3 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/lefilament_projets.py b/lefilament_projets.py
index 1a901bc..654182c 100644
--- a/lefilament_projets.py
+++ b/lefilament_projets.py
@@ -12,9 +12,10 @@ class SapovalPartners(models.Model):
 	lf_total_budget = fields.Float('Budget Projet',)
 	lf_tarif_jour = fields.Float('Tarif Jour',)
 	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_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
 	def _taux_horaire(self):
@@ -36,4 +37,11 @@ class SapovalPartners(models.Model):
 
 	@api.one
 	def _total_heures_restantes(self):
-		self.lf_heures_restantes = self.lf_heures_projet - self.lf_heures_passees
\ No newline at end of file
+		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
diff --git a/lefilament_projets.pyc b/lefilament_projets.pyc
index 7a7a034ff5055afa59d78dea153e937323f4b721..ec7b34830ecf4f7e24cfe6c07f3b8b25422266c2 100644
GIT binary patch
delta 665
zcmdnNcS)Fo`7<vUM+{rUMh;#^#;=pb7>ny!7_wLyQn(mWSQt{c8JZaxqqrGTA%Z+$
zL0+&R4?`+1Llz%H3LirY14A<-Lli$ugdZj%022{_i3q|(1YsgVFcBe$2nR!yFhfwV
zhVbM=j2VKw3=9m8IXU^IhgYT+D`;eBPPSumh$`l0U|<MJEiOsSD**|Xh%+!S#Fylk
zB<93tq?Q(?7RMJsWK)Za`571(0&)`bGSf0)hLlKPs4sx1m|V?to>647H**Oi-{b?#
zMl1ph3=ES6S;JVl7#J8NCI_;tWE7bEo28&$o`Hd(n1g|Vfq{vQQGij9F`1EpfdPb>
z7#J9wL9!rM)i5w*F))BgMh1x*28MVhh7<;dU=5H$KMiJ(KZHPpC<6mSi7*2LLrxlo
z7r=^xKrYb$*#{;jOSAg$@h~tjsDW$(S;;UtjwRkD2xLYHDA+(g%1cd&&&V$=DlQR0
zF&ZS7nU<NFS`2Xl$m}37kUKzb2KiSUWP}#TY-B%bh)k|yb(0qaspJC@pui1+dmsoD
zu0c|hZ?ej>2Z0<H#5;K}TdY<PI|Bm)$edys1_lN;Mm9z^CVobKMo}1K5@Hcz7h)G;
JnOwql1OV(3em(#I

delta 231
zcmca4yn~N}`7<w<`<gG|8##Cx8JABMV=T7hX2{}UNa12=VPI%xWQgKrNQH=S!$kOC
zB0Mk=euki64c^HDOc^2q3=9k&sij4!#R`czIr*iBSEd$E?qqV9tj2tXQE2jK<`PDp
z$r&t0jC_-O*dtlF7#JADCjVqv$;dZ(F>8UaECT~WF$V(!0|OHqvjC$YqlUobKkROz
z{0s~XK|COW7es(;2@;;1$RR(uiz7usgn@y9jggI!jftO;pHUP9nS@w`*eCOG9svMu
CIW7AD

diff --git a/views/lefilament_projets_view.xml b/views/lefilament_projets_view.xml
index 8139818..c036718 100644
--- a/views/lefilament_projets_view.xml
+++ b/views/lefilament_projets_view.xml
@@ -34,8 +34,10 @@
 			<field eval="0" name="sequence"/>
 			<field name="arch" type="xml">
 				<xpath expr="//field[@name='state']" position="after">
-					<field name="lf_heures_projet" />
 					<field name="lf_total_budget" />
+					<field name="lf_heures_projet" />
+					<field name="lf_heures_planifiees" />
+					<field name="lf_heures_restantes" />
 				</xpath>
 			</field>
 		</record>
@@ -48,17 +50,29 @@
                 <field name="arch" type="xml">
                         <xpath expr="//div[@class='o_kanban_primary_left']" position="after">
                         	<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">
                         		<thead style="background: transparent; border-bottom: 1px solid #555;">
                         			<tr>
-                        				<td style="padding: 5px 0;">prévu</td>
-                        				<td style="padding: 5px 0;">cours</td>
+                        				<td style="padding: 5px 0;">en cours</td>
                         				<td style="padding: 5px 0;">reste</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_passees" >h</field></td>
                         				<td style="padding: 5px 0;border-top: 1px solid #555;"><field name="lf_heures_restantes" >h</field></td>
                         			</tr>
-- 
GitLab