Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


How can I add a field to a phonecall and the transient model opportunity2phonecall?

Nicolas Lopez
on 7/17/14, 11:22 AM 547 views

Hi All

I'm trying to add a new many2one field called "phonecall type" to the phonecalls, so far it's simple and I had no problems there. Now as it can be also generated from an opportunity, I've added the same relationship to the opportunity2phonecall transient model. The problem is that the phonecall is created from the wizard, but the relationship is not saved. If I create a phonecall directly, it works fine.

Here the code of my ultra-simple module:

The new class phonecall_type:

class crm_phonecall_type(osv.osv):
    _name = "crm.phonecall.type"
    _description = "Phonecall type"
    _order = "name"

    _columns = {
        'name': fields.char('Name', required=True, translate=True),

Add the relationship to the phonecall:

class crm_phonecall(osv.osv):
    _inherit = "crm.phonecall"

    _columns = {
        'type_id': fields.many2one('crm.phonecall.type', string='Type',),

Add the relationship to the opportunity2phonecall:

class crm_opportunity2phonecall(osv.TransientModel):
    _inherit = "crm.opportunity2phonecall"

    _columns = {
        'type_id': fields.many2one('crm.phonecall.type', string='Type',),


Any ideas?


Thanks in advance,



Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 7/17/14, 11:22 AM
Seen: 547 times
Last updated: 3/16/15, 8:10 AM