From 3b5811d3503ad853727d11d7e44a453249de6ff7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <remi@le-filament.com>
Date: Mon, 26 Jun 2023 17:27:22 +0200
Subject: [PATCH] [UPD] Use sale_description in product description on SO

---
 data/product_template_data.xml | 2 +-
 models/sale_project.py         | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/data/product_template_data.xml b/data/product_template_data.xml
index 65b53c0..0b1b860 100644
--- a/data/product_template_data.xml
+++ b/data/product_template_data.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" ?>
 <odoo>
     <data noupdate="0">
-           <record id="ap_product_other_coll" model="product.template">
+        <record id="ap_product_other_coll" model="product.template">
             <field name="name">Collerette</field>
             <field name="type">product</field>
             <field name="categ_id" ref="ap_sale_project.product_category_other_hw" />
diff --git a/models/sale_project.py b/models/sale_project.py
index 4181b6b..0883c19 100644
--- a/models/sale_project.py
+++ b/models/sale_project.py
@@ -327,12 +327,17 @@ class SaleProject(models.Model):
                     data.update(
                         {
                             "order_id": self.sale_order_id.id,
-                            "name": "Projet " + self.name + " - " + product_tmpl.name,
+                            "name": "Projet "
+                            + self.name
+                            + " - "
+                            + product_tmpl.product_variant_id.get_product_multiline_description_sale(),
                             "product_id": product_tmpl.product_variant_id.id,
                             "sale_project_id": self.id,
                         }
                     )
-                    self.env["sale.order.line"].with_context(default_project_id=False).create(data)
+                    self.env["sale.order.line"].with_context(
+                        default_project_id=False
+                    ).create(data)
         self.sale_order_id.clean_sale_order()
 
 
-- 
GitLab