From 9fdbe3499a08a048df0684118f89f9372973c772 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 14 Sep 2016 12:54:15 +0200 Subject: [PATCH] [FIX] website_sale: fix product website description translation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an oversight during the conversion to the new API in the revision 788c1334e2cbe26fa26d4c6d4974dc413dbff608 `html_translate` allows to split the source term in several pieces, so the translations can be done pieces by pieces. For HTML fields, this is the default method of translation, EXCEPT if `sanitize´ is set to `False`. Unfortunately, this is the case for this field, and therefore `html_translate` must still be precised for this field, while, for other HTML fields, not having `sanitize` set to `False`, `translate=True` is enough to use the method `html_translate` opw-688470 --- addons/website_sale/models/product.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/website_sale/models/product.py b/addons/website_sale/models/product.py index f429b0930d1..5c896fd956d 100644 --- a/addons/website_sale/models/product.py +++ b/addons/website_sale/models/product.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, tools, _ +from odoo.tools.translate import html_translate class ProductStyle(models.Model): @@ -80,7 +81,7 @@ class ProductTemplate(models.Model): domain=lambda self: ['&', ('model', '=', self._name), ('message_type', '=', 'comment')], string='Website Comments', ) - website_description = fields.Html('Description for the website', sanitize=False, translate=True) + website_description = fields.Html('Description for the website', sanitize=False, translate=html_translate) alternative_product_ids = fields.Many2many('product.template', 'product_alternative_rel', 'src_id', 'dest_id', string='Suggested Products', help='Appear on the product page') accessory_product_ids = fields.Many2many('product.product', 'product_accessory_rel', 'src_id', 'dest_id',