Hello everyone,
I’m trying to make the company name (res.company.name) translatable in Odoo 18, because in many cases the legal company name needs to be translated per language.
from odoo import fields, models
class ResPartner(models.Model): _inherit = 'res.partner' name = fields.Char( string='Name', required=True, readonly=False, translate=True, ) class ResCompany(models.Model): _inherit = 'res.company' name = fields.Char( related='partner_id.name', string='Company Name', required=True, readonly=False, store=True, translate=True, )
Result:
- For normal partners (res.partner that are not companies) → the translation button appears correctly and translations work.
- For companies (res.company) → no translation button at all on the Name field, even though the field has translate=True and is stored.
Things I already checked/tried:
- Cache cleared, server restarted, module updated (-u my_module)
- The field is correctly stored in database (store=True)
Is there something special with related fields on res.company that prevents the translation button from being displayed?
Hello,
I have edited the answer can you try that.