[FIX] website_sale: fix product website description translation

This is an oversight during the conversion to the new API
in the revision
788c1334e2

`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
This commit is contained in:
Denis Ledoux
2016-09-14 12:59:15 +02:00
parent 01c68bc2a4
commit 9fdbe3499a
+2 -1
View File
@@ -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',