From 212467a7d890bcfab96ed986af6a14f109cc25f2 Mon Sep 17 00:00:00 2001
From: hsilvant <hsilvant@scop.coop>
Date: Thu, 3 Sep 2020 17:17:45 +0200
Subject: [PATCH] =?UTF-8?q?Correction=20qt=C3=A9=20/=202?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 models/hr_expense.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/models/hr_expense.py b/models/hr_expense.py
index b57e72b..4bf33ce 100644
--- a/models/hr_expense.py
+++ b/models/hr_expense.py
@@ -123,10 +123,12 @@ class CGScopExpense(models.Model):
         """
         Définit le comportement lorsqu'on coche Aller/Retour
         """
-        if self.is_return:
-            self.quantity = self.quantity * 2
-        elif not self.is_return:
-            self.quantity = self.quantity / 2
+        if ((self.product_id.expense_formula == 'fixed_price') and 
+            (self.product_id.is_ik)):
+            if self.is_return:
+                self.quantity = self.quantity * 2
+            elif not self.is_return:
+                self.quantity = self.quantity / 2
 
     # ------------------------------------------------------
     # Button function
-- 
GitLab