Community mailing list archives

community@mail.odoo.com

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

by
Anders Wallenquist
- 04/23/2015 12:06:16
Here are the code: https://github.com/vertelab/odoo-mass_mailing/blob/master/mass_mailing_extra/mass_mailing_stats.py

Den 2015-04-23 17:57, Jay Vora skrev:
<blockquote cite="mid:CACHFH7=b2x9twr1oAMHxz6NQR092+kXSn4MtVjecF74fDSFaAg@mail.gmail.com" type="cite">
Anders,

Glad to hear that!

Thanks.

On Thu, Apr 23, 2015 at 9:18 PM, Anders Wallenquist <anders.wallenquist@vertel.se> wrote:


Den 2015-04-23 16:22, Jay Vora skrev:
<blockquote cite="mid:CACHFH7nRnvsTaw_i-2Uf98fS4P7W2Qap7RyTAgORp2wN=9zSsg@mail.gmail.com" type="cite">
Anders,

You may plan to use fields.reference!

Yes, that solved it! Thank you!

Regards,

Anders Wallenquist
Vertel AB

<blockquote cite="mid:CACHFH7nRnvsTaw_i-2Uf98fS4P7W2Qap7RyTAgORp2wN=9zSsg@mail.gmail.com" type="cite">

Thanks.

On Thu, Apr 23, 2015 at 7:47 PM, Anders Wallenquist <anders.wallenquist@vertel.se> wrote:
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

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
The Splendid journey of 2 years in Numbers
---
Regards,
Jay Vora,
Managing Director,
<img src="cid:part1.09000700.05080805@serpentcs.com" style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Serpent Consulting Services Pvt. Ltd.
Web : http://www.serpentcs.com
Mobile : 91 - 9879354457
Twitter: jaynvora
Skype: jaynvora
Blog : http://jayvora.blogspot.com

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
The Splendid journey of 2 years in Numbers
---
Regards,
Jay Vora,
Managing Director,
<img src="cid:part1.09000700.05080805@serpentcs.com" style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Serpent Consulting Services Pvt. Ltd.
Web : http://www.serpentcs.com
Mobile : 91 - 9879354457
Twitter: jaynvora
Skype: jaynvora
Blog : http://jayvora.blogspot.com

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe