From 5b6a7f8b647f9061b1c17fa3cb2c0378fe18b0d2 Mon Sep 17 00:00:00 2001
From: Juliana <juliana@le-filament.com>
Date: Wed, 5 Oct 2022 15:06:44 +0200
Subject: [PATCH] [UPD]Change facftures clients place

---
 models/account.py                           |  1 +
 wizard/adefpat_project_justif_zip_wizard.py | 15 ++++++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/models/account.py b/models/account.py
index d4571a0..61d44b4 100644
--- a/models/account.py
+++ b/models/account.py
@@ -90,5 +90,6 @@ class AccountInvoice(models.Model):
                 'adefpat:factureStartDate': fields.Datetime.to_datetime(
                     self.date_invoice).isoformat(),
                 'adefpat:factureTypeConvention': self.type_convention_id.name or "",
+                'adefpat:factureProjet': str(self.project_id.id) or "",
             }
 
diff --git a/wizard/adefpat_project_justif_zip_wizard.py b/wizard/adefpat_project_justif_zip_wizard.py
index 2438ef1..89e5fcd 100644
--- a/wizard/adefpat_project_justif_zip_wizard.py
+++ b/wizard/adefpat_project_justif_zip_wizard.py
@@ -33,9 +33,7 @@ class AdefpatProjectJustifZip(models.TransientModel):
         json_file = []
         json_file_proj = self.build_json_project("11")
         json_file.append(json_file_proj)
-        json_file_fc = self.build_json_file_facture_client("31")
-        json_file.append(json_file_fc)
-        json_file_frais = self.build_json_file_expense_zip("41")
+        json_file_frais = self.build_json_file_expense_zip("21")
         json_file.append(json_file_frais)
 
         virtual_json = {
@@ -144,6 +142,17 @@ class AdefpatProjectJustifZip(models.TransientModel):
                                     self.period_start) + "' TO '" + str(self.period_end) + "']) AND =adefpat:factureProjet:'"+ str(project_id) +"'",
                             },
                         },
+                        {
+                            "id": bilan_nb + str(compteur) + "8",
+                            "name": "Factures Clients",
+                            "description": "Factures Clients",
+                            "search": {
+                                "language": "fts-alfresco",
+                                "query": "(PATH:'/app:company_home/st:sites/cm:odoo/cm:documentLibrary/cm:Factures_x0020_clients//*') AND (+adefpat:factureStartDate:['" + str(
+                                    self.period_start) + "' TO '" + str(
+                                    self.period_end) +"']) AND =adefpat:factureProjet:'"+ str(project_id) +"'",
+                            },
+                        },
                 ]})
 
         virtual_json = {
-- 
GitLab