I’m trying to use Prototype inheritance from the res.partner model in Odoo 17.
class MyPartnerExt(models.Model):
_inherit = 'res.partner'
_name = 'my.partner.ext'
custom_id = fields.Integer()
However, when I try to save an instance of this model, I get the following exception:
File "/Users/markns/workspace/odoo/odoo/odoo/fields.py", line 3055, in convert_to_cache
raise ValueError("Wrong value for %s: %r" % (self, value))
ValueError: Wrong value for my.partner.ext.commercial_partner_id: my.partner.ext(4,)
I see some other questions related to this error: here, here and here but no solutions.
Is it possible (or recommended) to subclass res.partner with prototype inheritance (ie. _name + _inherit)?