Community mailing list archives

community@mail.odoo.com

How do I change comodel_name (relation) on the fly?

by
Anders Wallenquist
- 04/23/2015 10:12:46
I whould like to change the model on a Many2one-field:

id_record = fields.Many2one(comodel_name="_unknown")

....

self.id_record.comodel_name = 'res.partner'
self.id_record = self.env['res.partner'].browse(self.res_id)

Regards,

Anders Wallenquist
Vertel AB