From 68432367b2fc293dc0511356751bd7e75f088886 Mon Sep 17 00:00:00 2001
From: Remi <30716308+remi-filament@users.noreply.github.com>
Date: Mon, 26 Feb 2018 15:53:17 +0100
Subject: [PATCH] Change way of calculating real costs

---
 models/project.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/models/project.py b/models/project.py
index fd26fb9..d348bc3 100644
--- a/models/project.py
+++ b/models/project.py
@@ -68,7 +68,7 @@ class FilamentProjet(models.Model):
 	def _couts_annexes(self):
 		account = self.analytic_account_id.id		
 		##############    Calcul couts annexes   ################
-		self.env.cr.execute("select sum(untaxed_amount) from hr_expense where analytic_account_id=%s;", (account, ) )
+		self.env.cr.execute("select -sum(amount) from account_analytic_line where account_id=%s and project_id is null and ref is not null;", (account, ) )
 		couts_annexes = self.env.cr.fetchone()[0]
 		if couts_annexes:
 			self.lf_couts_annexes = couts_annexes
-- 
GitLab