From 43f25cc0a88be4550d5f4d723979b9c53577484a Mon Sep 17 00:00:00 2001
From: Juliana <juliana@le-filament.com>
Date: Thu, 28 Apr 2022 10:59:58 +0200
Subject: [PATCH] [FIX]Bug on generation invoice interval

---
 models/acc_operation.py     |  3 ++-
 report/account_template.xml | 12 ++++--------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/models/acc_operation.py b/models/acc_operation.py
index 5dd021c..759064b 100644
--- a/models/acc_operation.py
+++ b/models/acc_operation.py
@@ -226,7 +226,8 @@ class AccOperation(models.Model):
                                     ("acc_operation_id", "=", self.id),
                                     ("acc_injection_id", "=", acc_injection_id.id),
                                     ("acc_delivery_id", "=", acc_delivery_id.id),
-                                    ("end_date", ">=", date_start),
+                                    "|", ("end_date", ">=", date_start),
+                                    ("end_date", "=", False),
                                 ]
                             )
                             price2_ids = self.env["acc.sale.price"].search(
diff --git a/report/account_template.xml b/report/account_template.xml
index 79f759d..e23c461 100644
--- a/report/account_template.xml
+++ b/report/account_template.xml
@@ -240,7 +240,7 @@
                                             class="font-weight-bold"
                                         >Courrier:</span><br />
                                         <span t-field="o.consumer_id.email" /><br />
-                                        <span
+                                        <span t-if="o.consumer_id.ref"
                                             class="font-weight-bold"
                                         >Référence Client:</span><br />
                                         <span t-field="o.consumer_id.ref" />
@@ -309,16 +309,12 @@
                                         <span
                                             class="font-weight-bold"
                                         >Nom producteur</span><br />
-                                        <span
-                                            class="font-weight-bold"
-                                            t-field="o.producer_id.name"
+                                        <span t-field="o.producer_id.name"
                                         /><br />
                                         <span
                                             class="font-weight-bold"
                                         >Référence point d'injection (PRM):</span><br />
-                                        <span
-                                            class="font-weight-bold"
-                                            t-field="o.acc_injection_id.name"
+                                        <span t-field="o.acc_injection_id.name"
                                         /><br />
                                         <span
                                             class="text-center font-weight-bold"
@@ -464,7 +460,7 @@
                             <span>BIC : <t t-esc="o.producer_id.bic" /></span><br />
                             <br />
                             <span
-                            >Merci de bien vouloir indiquer le numéro de facture et/ou votre référence client sur l’ordre de virement</span>
+                            >Merci de bien vouloir indiquer le numéro de facture sur l’ordre de virement</span>
                         </p>
                         <div class="row mt32 mb32" style="page-break-before:always;">
                             <div class="col-12">
-- 
GitLab