The error you're encountering occurs because the name field of res.partner is related to the name field of res.company, and in Odoo 17, the translation mechanism requires the related fields to explicitly support translations as well.
In Odoo 15, this wasn't as strict, but starting from Odoo 17, you need to ensure that any related fields that reference translatable fields also have the translate=True attribute.
In your case, the res.company model has a field like this:
name = fields.Char(related='partner_id.name', string='Company Name', required=True, store=True, readonly=False)
To fix the error, you need to override this field and add the translate=True attribute to it, like so:
name = fields.Char(related='partner_id.name', string='Company Name', required=True, store=True, readonly=False, translate=True)
By doing this, the translation mechanism will apply not only to the name field of res.partner but also to the name field in res.company, which is crucial for avoiding the PostgreSQL error related to the JSON extraction operator (->>). This adjustment ensures that both fields are handled correctly when translations are applied.