From e39137ab8e519e3ecf0fa3a69552232fe7a38830 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <remi@le-filament.com>
Date: Wed, 17 Nov 2021 23:20:09 +0100
Subject: [PATCH] [IMP] update sol name

---
 models/sale_intervention.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/models/sale_intervention.py b/models/sale_intervention.py
index b0f6cef..9b19451 100644
--- a/models/sale_intervention.py
+++ b/models/sale_intervention.py
@@ -9,7 +9,7 @@ class SaleIntervention(models.Model):
 
     def _update_order_lines(self):
         """
-        Rewrite function to use TVA
+        Rewrite function to use Taxes
         """
         product_tmpl = self.intervention_type_id
         plant_categ_id = self.env.ref("ap_sale_project.product_category_plant")
@@ -85,13 +85,14 @@ class SaleIntervention(models.Model):
                         "product_uom_qty": quantity,
                         "sale_project_id": self.project_id.id,
                     }
+                    sol_name = (
+                        "Projet " + self.project_id.name + " - " + product_tmpl.name
+                    )
                     sols.append(
                         {
                             **data_sol_section,
                             **{
-                                "name": self.project_id.name
-                                + " - "
-                                + product_tmpl.name,
+                                "name": sol_name,
                                 "display_type": "line_section",
                             },
                         }
@@ -101,7 +102,7 @@ class SaleIntervention(models.Model):
                             **data_sol_section,
                             **{
                                 "price_unit": plant_price,
-                                "name": "Plants garantis 3 ans",
+                                "name": sol_name + " - Plants garantis 3 ans",
                                 "tax_id": [(6, 0, vat_plant_categ.ids)],
                             },
                         }
@@ -111,8 +112,8 @@ class SaleIntervention(models.Model):
                             **data_sol_section,
                             **{
                                 "price_unit": price_unit - plant_price,
-                                "name": "Paillage, protections, ingénierie, "
-                                "livraison et suivi",
+                                "name": sol_name + " - Paillage, protections, "
+                                "ingénierie, livraison et suivi",
                                 "tax_id": [(6, 0, vat_furniture_categ.ids)],
                             },
                         }
-- 
GitLab