This question has been flagged

How can the description_sales be shown as html in the website ?

So, I have the following description on a product , on the sales tab:

---

<em> test nope ! </em> <ul> <b>Description</b> <li>White Wine - Organic Farming </li> <li> DO Montsant</li> <li> The essence of the white Grenache from old vines grown in accordance to organic farming. Wine with a small ageing sur lees.</li> <li> Quite mineral, with character and freshness.</li> <li> Tropical fruits, pears, apples and limes.</li> <li> Refreshing. Herbaceous and saline notes.</li> <li> The ageing in bottle gives it creaminess.</li> </ul> Production • Alcohol 13,50% • Production 5.000 bottles

----

I would like to show it as html on the website, but instead appear as is, as text , with all the html tags.

My understanding is that there is no way to do so because description_sales is a text field to be shown on each quote, but it is more important for me the website than the quote.

Can this be done ?

It would be OK if it was markdown, or html, or even if a flag has to be set.

Thanks.

Related : https://www.odoo.com/forum/help-1/question/product-description-in-odoo-12-148541


Avatar
Discard
Best Answer

is this also possible in the reports or in the webview of the quote? I edited the product.description_sale field as html widget. On the Website / product view its working.

But what need to be changed in the reports that the sales order line is also html. And as writen above, in the frontend where the customer can view the quote, it's also prerendert without html function.

Odoo Beratung Deutschland

Avatar
Discard
Best Answer

Put your description in the Description for Customers field:

Make a small change to the way that field is rendered, by making your own View that inherits and overrides the base View that renders the field as a text field:


In the Product view (External ID:  website_sale.product), you will see this line is the way Odoo renders that field:

     <p t-field="product.description_sale" class="text-muted" />


In your own view you would hide that paragraph ** and render the contents as RAW html:

     <p  hidden="hidden" t-field="product.description_sale" class="text-muted" />
     <p t-raw="product.description_sale" class="text-muted"/>


You end up with this:


Additional Help:

https://www.odoo.com/documentation/12.0/howtos/backend.html#view-inheritance

https://www.opensourceintegrators.com/publications/update-safe-changes-to-odoo-views


** hiding is a BEST PRACTICE when you make changes to ANY View in Odoo.  Many modules inherit and override Views and you never know when another View might be looking for something to anchor against. In this case, removing the paragraph will cause problems depending on what other modules are installed, so that's why we are hiding it instead.

Avatar
Discard