Steps to reproduce: -install website, website_partner, contacts and studio -go to contacts and open any partner -click the studio icon (top-right corner of the screen) -add the 'website_description' field to the partner Previous behavior: the description field is not translatable and attempting to change the "translatable" option in technical > fields spawns an error Current behavior: the description field is translatable opw-2155115 closes odoo/odoo#42043 X-original-commit: 186b599246321465eae937b875b6c970656b145a Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
19 lines
682 B
Python
19 lines
682 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from odoo import api, fields, models
|
|
from odoo.addons.http_routing.models.ir_http import slug
|
|
from odoo.tools.translate import html_translate
|
|
|
|
|
|
class WebsiteResPartner(models.Model):
|
|
_name = 'res.partner'
|
|
_inherit = ['res.partner', 'website.seo.metadata']
|
|
|
|
website_description = fields.Html('Website Partner Full Description', strip_style=True, translate=html_translate)
|
|
website_short_description = fields.Text('Website Partner Short Description')
|
|
|
|
def _compute_website_url(self):
|
|
super(WebsiteResPartner, self)._compute_website_url()
|
|
for partner in self:
|
|
partner.website_url = "/partners/%s" % slug(partner)
|